From: da490c Date: Thu, 22 Mar 2018 04:32:52 +0000 (-0400) Subject: Convert Sparky to Spring-Boot X-Git-Tag: v1.2.0~27 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F37647%2F4;p=aai%2Fsparky-be.git Convert Sparky to Spring-Boot Issue-ID: AAI-599 Change-Id: If474dd02794f442fdddcd90f62fb75e0d6b907e7 Signed-off-by: da490c --- diff --git a/.gitignore b/.gitignore index f9ddb89..031424d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ aaiOffline/ target/ logs/ debug-logs/ -appconfig-local/ +*/appconfig-local/ diff --git a/ajsc-shared-config/README.txt b/ajsc-shared-config/README.txt deleted file mode 100644 index 37f2670..0000000 --- a/ajsc-shared-config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -The bundleconfig-local directory contains the necessary configuration files \ No newline at end of file diff --git a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml b/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml deleted file mode 100644 index 4ebe2db..0000000 --- a/ajsc-shared-config/etc/basic-logback_root_logger_level_off.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - ERROR - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n - - - - - - - DEBUG - - ${logDirectory}/info_ajsc.log - - ${logDirectory}/info_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - ERROR - - ${logDirectory}/error_ajsc.log - - ${logDirectory}/error_ajsc.%i.log.zip - - 1 - 9 - - - 5MB - - - - "%d [%thread] %-5level %logger{1024} - %msg%n" - - - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] %msg - - - - INFO - - localhost - USER - - AJSC_AUDIT: [%thread] [%logger] mdc:[%mdc] %msg - - - - - - - - - diff --git a/ajsc-shared-config/etc/logback.xml b/ajsc-shared-config/etc/logback.xml deleted file mode 100644 index c57cfc4..0000000 --- a/ajsc-shared-config/etc/logback.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - ${errorLogPattern} - - - - - - - - - - - ${logDirectory}/${generalLogName}.log - - ${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.log.gz - - 60 - - - ${errorLogPattern} - - - - - - INFO - - 256 - - - - - - - - ${logDirectory}/${auditLogName}.log - - ${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.log.gz - 60 - - - ${auditMetricPattern} - - - - 256 - - - - - - ${logDirectory}/${metricsLogName}.log - - ${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.log.gz - 60 - - - - ${auditMetricPattern} - - - - - 256 - - - - - - - - ${logDirectory}/${debugLogName}.log - - ${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.log.gz - 60 - - - ${errorLogPattern} - - - - - 256 - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ajsc-shared-config/etc/spm2.jks b/ajsc-shared-config/etc/spm2.jks deleted file mode 100644 index 8ff2a00..0000000 Binary files a/ajsc-shared-config/etc/spm2.jks and /dev/null differ diff --git a/antBuild/build.xml b/antBuild/build.xml deleted file mode 100644 index ab0f890..0000000 --- a/antBuild/build.xml +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bundleconfig-local/README.txt b/bundleconfig-local/README.txt deleted file mode 100644 index 37f2670..0000000 --- a/bundleconfig-local/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -The bundleconfig-local directory contains the necessary configuration files \ No newline at end of file diff --git a/bundleconfig-local/RELEASE_NOTES.txt b/bundleconfig-local/RELEASE_NOTES.txt deleted file mode 100644 index 3cc5590..0000000 --- a/bundleconfig-local/RELEASE_NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -Place Release Notes here to provide updated Release information \ No newline at end of file diff --git a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties b/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties deleted file mode 100644 index 08ffefa..0000000 --- a/bundleconfig-local/etc/appprops/PostProcessorInterceptors.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -#This properties file is for defining any PostProcessorInterceptors that have been created for your AJSC service. - diff --git a/bundleconfig-local/etc/appprops/app-intercepts.properties b/bundleconfig-local/etc/appprops/app-intercepts.properties deleted file mode 100644 index 8778195..0000000 --- a/bundleconfig-local/etc/appprops/app-intercepts.properties +++ /dev/null @@ -1,8 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. - -#This is where all your application intercept strategies must be configured. AJSC reads this property file and adds -#the list of intercepts specified here to the camel context. This can be useful for accessing every exchange object transferred from/to -#each endpoint in the request/response flow and can allow for more precise debugging and/or processing of the exchange. - -#e.g. -#intercepts=org.openecomp.inventory.JaxrsEchoService,packagename.class1name,packagename.class2name diff --git a/bundleconfig-local/etc/appprops/methodMapper.properties b/bundleconfig-local/etc/appprops/methodMapper.properties deleted file mode 100644 index 57e12b0..0000000 --- a/bundleconfig-local/etc/appprops/methodMapper.properties +++ /dev/null @@ -1,46 +0,0 @@ -// -//Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -// Json object holds the method mapping.Update the JSON object with the proper route to logical mapping based -// on the example provided below : -// "helloWorld" = Service Name -// "method" = http method -// "url" = the url component from the route -// "logicalName"= When a combination of method and url from the route matches the json object , -// the logical name is put in the http header as "x-CSI-ServiceName" and "x-CSI-MethodName" -// "dme2url"= if provided it register the endpoint to GRM, it is optional. This is useful for JAX-RS services. - -{ - "helloWorld": [ - { - "method": "get", - "url": "/rest/inventory-ui-service/v1/helloWorld", - "logicalName": "GetMethod(Logical)" - }, - { - "method": "get", - "url": "/services/inventory-ui-service/v1/jaxrsExample/jaxrs-services/echo/{input}", - "logicalName": "GetJaxrsExampleEcho(Logical)", - "dme2url": "/services/inventory-ui-service/v1/jaxrsExample/jaxrs-services/echo/{input}" - }, - { - "method": "get", - "url": "/services/inventory-ui-service/v1/jaxrsExample/jaxrs-services/property/{fileName}/{input}", - "logicalName": "GetJaxrsExampleProperty(Logical)", - "dme2url": "/services/inventory-ui-service/v1/jaxrsExample/jaxrs-services/property/{fileName}/{input}" - } - ], - "errormessage": - [ - { - "method": "get", - "url": "/services/inventory-ui-service/v1/jaxrsExample/errormessage/emls", - "logicalName": "setCAETHeaders(Logical)" - }, - { - "method": "get", - "url": "/services/inventory-ui-service/v1/errorMessageLookupService2", - "logicalName": "setCAETHeaders(Logical)" - } - - ] -} \ No newline at end of file diff --git a/bundleconfig-local/etc/appprops/source-of-truth.properties.bak b/bundleconfig-local/etc/appprops/source-of-truth.properties.bak deleted file mode 100644 index f08722f..0000000 --- a/bundleconfig-local/etc/appprops/source-of-truth.properties.bak +++ /dev/null @@ -1,47 +0,0 @@ -# Source of Truth mappings. This file maps an enitity path to a source of truth identifier -# AAI v7 -/v7/network/ipsec-configurations/ipsec-configuration/requested-vig-address-type=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/requested-encryption-strength=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/requested-dmz-type=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/shared-dmz-network-address=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/requested-customer-name=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ike-version=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-authentication=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-encryption=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-dh-group=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-am-group-id=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-am-password=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ikev1-sa-lifetime=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ipsec-authentication=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ipsec-encryption=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ipsec-sa-lifetime=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/ipsec-pfs=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/xauth-userid=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/xauth-user-password=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/dpd-interval=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/dpd-frequency=service-manager -/v7/network/ipsec-configurations/ipsec-configuration/vig-servers=service-manager - -# AAI v8 -/v8/network/ipsec-configurations/ipsec-configuration/requested-vig-address-type=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/requested-encryption-strength=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/requested-dmz-type=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/shared-dmz-network-address=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/requested-customer-name=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ike-version=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-authentication=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-encryption=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-dh-group=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-am-group-id=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-am-password=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ikev1-sa-lifetime=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ipsec-authentication=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ipsec-encryption=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ipsec-sa-lifetime=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/ipsec-pfs=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/xauth-userid=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/xauth-user-password=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/dpd-interval=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/dpd-frequency=service-manager -/v8/network/ipsec-configurations/ipsec-configuration/vig-servers=service-manager - diff --git a/bundleconfig-local/etc/sysprops/sys-props.properties b/bundleconfig-local/etc/sysprops/sys-props.properties deleted file mode 100644 index 4aed03f..0000000 --- a/bundleconfig-local/etc/sysprops/sys-props.properties +++ /dev/null @@ -1,119 +0,0 @@ -#Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. -#This file is used for defining AJSC system properties for different configuration schemes and is necessary for the AJSC to run properly. -#The sys-props.properties file is used for running locally. The template.sys-props.properties file will be used when deployed -#to a SOA/CSI Cloud node. - -#AJSC System Properties. The following properties are required for ALL AJSC services. If you are adding System Properties for your -#particular service, please add them AFTER all AJSC related System Properties. - -#For Cadi Authorization, use value="authentication-scheme-1 -CadiAuthN=authentication-scheme-1 - -#For Basic Authorization, use value="authentication-scheme-1 -authN=authentication-scheme-2 - -#Persistence used for AJSC meta-data storage. For most environments, "file" should be used. -ajscPersistence=file - -#For Direct Invocation to be enabled (values=true/false) -directInvocationEnable=false - -# If using hawtio for local development, these properties will allow for faster server startup and usage for local development - -hawtio.authenticationEnabled=false -hawtio.config.pullOnStartup=false - -#Removes the extraneous restlet console output -org.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade - -#server.host property to be enabled for local DME2 related testing -#server.host= - -#Enable/disable SSL (values=true/false). This property also determines which protocol to use (https if true, http otherwise), to register services into GRM through DME2. -enableSSL=true - - -#Enable/disable EJB Container -ENABLE_EJB=false - -#Enable/disable OSGI -isOSGIEnable=false - -#Generate/Skip api docs -isApiDoc=false - -#CSI related variables for CSM framework -csm.hostname=servername - - -#SOA_CLOUD_ENV is used to register your service with dme2 and can be turned off for local development (values=true/false). -SOA_CLOUD_ENV=false - -#CONTINUE_ON_LISTENER_EXCEPTION will exit the application if there is a DME2 exception at the time of registration. -CONTINUE_ON_LISTENER_EXCEPTION=false - -#Jetty Container ThreadCount Configuration Variables -AJSC_JETTY_ThreadCount_MIN=1 -AJSC_JETTY_ThreadCount_MAX=200 -AJSC_JETTY_IDLETIME_MAX=3000 - -#Camel Context level default threadPool Profile configuration -CAMEL_POOL_SIZE=10 -CAMEL_MAX_POOL_SIZE=20 -CAMEL_KEEP_ALIVE_TIME=60 -CAMEL_MAX_QUEUE_SIZE=1000 - -#GRM/DME2 System Properties -AFT_DME2_CONN_IDLE_TIMEOUTMS=5000 -AJSC_ENV=SOACLOUD - -SOACLOUD_NAMESPACE=com.att.ajsc -SOACLOUD_ENV_CONTEXT=DEV -SOACLOUD_PROTOCOL=http -SOACLOUD_ROUTE_OFFER=DEFAULT - -AFT_LATITUDE=23.4 -AFT_LONGITUDE=33.6 -AFT_ENVIRONMENT=AFTUAT - -#Restlet Component Default Properties -RESTLET_COMPONENT_CONTROLLER_DAEMON=true -RESTLET_COMPONENT_CONTROLLER_SLEEP_TIME_MS=100 -RESTLET_COMPONENT_INBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_MIN_THREADS=1 -RESTLET_COMPONENT_MAX_THREADS=10 -RESTLET_COMPONENT_LOW_THREADS=8 -RESTLET_COMPONENT_MAX_QUEUED=0 -RESTLET_COMPONENT_MAX_CONNECTIONS_PER_HOST=-1 -RESTLET_COMPONENT_MAX_TOTAL_CONNECTIONS=-1 -RESTLET_COMPONENT_OUTBOUND_BUFFER_SIZE=8192 -RESTLET_COMPONENT_PERSISTING_CONNECTIONS=true -RESTLET_COMPONENT_PIPELINING_CONNECTIONS=false -RESTLET_COMPONENT_THREAD_MAX_IDLE_TIME_MS=60000 -RESTLET_COMPONENT_USE_FORWARDED_HEADER=false -RESTLET_COMPONENT_REUSE_ADDRESS=true - -#Externalized jar and properties file location. In CSI environments, there are a few libs that have been externalized to aid -#in CSTEM maintenance of the versions of these libs. The most important to the AJSC is the DME2 lib. Not only is this lib necessary -#for proper registration of your AJSC service on a node, but it is also necessary for running locally as well. Another framework -#used in CSI envs is the CSM framework. These 2 framework libs are shown as "provided" dependencies within the pom.xml. These -#dependencies will be copied into the target/commonLibs folder with the normal "mvn clean package" goal of the AJSC. They will -#then be added to the classpath via AJSC_EXTERNAL_LIB_FOLDERS system property. Any files (mainly property files) that need -#to be on the classpath should be added to the AJSC_EXTERNAL_PROPERTIES_FOLDERS system property. The default scenario when -#testing your AJSC service locally will utilize the target/commonLibs directory for DME2 and CSM related artifacts and 2 -#default csm properties files will be used for local testing with anything CSM knorelated. -#NOTE: we are using maven-replacer-plugin to replace "(doubleUnderscore)basedir(doubleUnderscore)" with ${basedir} within the -#target directory for running locally. Multiple folder locations can be separated by the pipe ("|") character. -#Please, NOTE: for running locally, we are setting this system property in the antBuild/build.xml "runLocal" target and in the -#"runAjsc" profile within the pom.xml. This is to most effectively use maven variables (${basedir}, most specifically. Therefore, -#when running locally, the following 2 properties should be set within the profile(s) themselves. -#Example: target/commonLibs|target/otherLibs -#AJSC_EXTERNAL_LIB_FOLDERS=__basedir__/target/commonLibs -#AJSC_EXTERNAL_PROPERTIES_FOLDERS=__basedir__/ajsc-shared-config/etc -#End of AJSC System Properties - -#Service System Properties. Please, place any Service related System Properties below. - -KEY_STORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o -KEY_MANAGER_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o - diff --git a/pom.xml b/pom.xml index ad16a56..e70bffe 100644 --- a/pom.xml +++ b/pom.xml @@ -1,624 +1,15 @@ - + - 4.0.0 - - - ajsc-archetype-parent - com.att.ajsc - 2.0.0 - - org.onap.aai.sparky-be - sparky-be - 1.2.0-SNAPSHOT - aai-sparky-be - - - ${basedir}/target - inventory-ui-service - v1 - 2.0.0 - /appl/${project.artifactId} - org.onap.aai - sparky-fe - 1.1.0-SNAPSHOT - - - /appl/${project.artifactId}/${project.version} - ${basedir}/target/swm/package/nix/dist_files${distFilesRoot} - - - aaiadmin - aaiadmin - com.att.csid.lab - - - 9517 - 8000 - - workstation - DEV - google_checks.xml - https://nexus.onap.org - - - java - jacoco - ${project.build.directory}/surefire-reports - ${project.build.directory}/coverage-reports/jacoco.exec - false - ${project.version} - - - - - org.mockito - mockito-all - 1.10.19 - test - - - org.powermock - powermock-module-junit4 - 1.6.2 - test - - - org.powermock - powermock-api-mockito - 1.6.2 - test - - - org.powermock - powermock-module-javaagent - 1.6.2 - test - - - org.powermock - powermock-module-junit4-rule-agent - 1.6.2 - test - - - - - dom4j - dom4j - 1.6.1 - provided - - - com.att.aft - dme2 - 3.1.200 - provided - - - - org.slf4j - slf4j-api - 1.7.20 - - - - org.hamcrest - hamcrest-library - 1.3 - test - - - - org.eclipse.persistence - eclipselink - 2.6.2 - - - - com.fasterxml.jackson.core - jackson-core - 2.7.4 - - - - org.json - json - 20131018 - - - - com.fasterxml.jackson.core - jackson-databind - 2.7.4 - - - - org.onap.aai.logging-service - common-logging - 1.2.0 - - - - org.onap.aai.aai-common - aai-schema - 1.2.0 - - - - org.onap.aai - rest-client - 1.2.0 - - - - com.google.code.gson - gson - 2.6.2 - - - - ch.qos.logback - logback-classic - 1.1.7 - - - - ch.qos.logback - logback-core - 1.1.7 - - - - commons-io - commons-io - 2.4 - - - - log4j - log4j - 1.2.17 - - - - com.openpojo - openpojo - 0.8.6 - - - - org.onap.portal.sdk - epsdk-fw - 1.3.0 - - - commons-logging - commons-logging - - - log4j - log4j - - - log4j - apache-log4j-extras - - - org.slf4j - slf4j-log4j12 - - - - - - - - - runAjsc - - initialize - - - - org.codehaus.mojo - exec-maven-plugin - 1.3.2 - - - initialize - - java - - - false - true - java - com.att.ajsc.runner.Runner - - com.att.ajsc - ajsc-runner - - - ${basedir}/ajsc-shared-config/etc - - - - ${runAjscHome} - - - - - - AJSC_HOME - ${runAjscHome} - - - CONFIG_HOME - ${basedir}/appconfig-local/ - - - AJSC_CONF_HOME - ${basedir}/bundleconfig-local - - - logback.configurationFile - ${basedir}/ajsc-shared-config/etc/logback.xml - - - AJSC_SHARED_CONFIG - ${basedir}/ajsc-shared-config - - - - AJSC_EXTERNAL_LIB_FOLDERS - ${basedir}/target/commonLibs - - - AJSC_EXTERNAL_PROPERTIES_FOLDERS - ${basedir}/ajsc-shared-config/etc - - - - AJSC_SERVICE_NAMESPACE - ${module.ajsc.namespace.name} - - - AJSC_SERVICE_VERSION - ${module.ajsc.namespace.version} - - - SOACLOUD_SERVICE_VERSION - ${project.version} - - - server.port - ${serverPort} - - - - - - context=/ - port=${serverPort} - sslport=${sslport} - - - - - - java - - - - com.att.ajsc - ajsc-runner - ${ajscRuntimeVersion} - - - - - - - - - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - true - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.codehaus.mojo - - - properties-maven-plugin - - - [1.0-alpha-2,) - - - - write-project-properties - - - - - - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.0.0 - - - copy-installed - install - - copy - - - - - ${frontEndGroupdId} - ${frontEndArtifactId} - ${frontEndVersion} - war - ${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extApps/ - aai.war - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - copy-docker-file - package - - copy-resources - - - target - true - - - ${basedir}/src/main/docker - true - - **/* - - - - ${basedir}/src/main/scripts/ - - - - - - - - - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.3 - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - - checkstyle - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - copy-docker-file - package - - copy-resources - - - target - true - - - ${basedir}/src/main/docker - true - - **/* - - - - ${basedir}/src/main/scripts/ - - - - - - - - com.spotify - docker-maven-plugin - 0.4.11 - - true - docker-hub - ${docker.push.registry}/onap/${project.artifactId} - ${docker.location} - - latest - - true - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ${nexusproxy} - 176c31dfe190a - ecomp-staging - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.codehaus.mojo - sonar-maven-plugin - 3.2 - - - org.jacoco - jacoco-maven-plugin - 0.7.7.201606060606 - - true - - - - jacoco-initialize-unit-tests - - prepare-agent - - - ${project.build.directory}/coverage-reports/jacoco.exec - - - - - - - - - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.onap.aai + sparky-be + 1.2.0-SNAPSHOT + pom + + + sparkybe-onap-service/pom.xml + sparkybe-onap-application/pom.xml + \ No newline at end of file diff --git a/sparkybe-onap-application/LICENSE b/sparkybe-onap-application/LICENSE new file mode 100644 index 0000000..c8636af --- /dev/null +++ b/sparkybe-onap-application/LICENSE @@ -0,0 +1,18 @@ +============LICENSE_START======================================================= +org.onap.aai +================================================================================ +Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. +Copyright © 2017-2018 Amdocs +================================================================================ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +============LICENSE_END========================================================= \ No newline at end of file diff --git a/eclipse-config/eclipse-java-google-style.xml b/sparkybe-onap-application/eclipse-config/eclipse-java-google-style.xml similarity index 100% rename from eclipse-config/eclipse-java-google-style.xml rename to sparkybe-onap-application/eclipse-config/eclipse-java-google-style.xml diff --git a/sparkybe-onap-application/pom.xml b/sparkybe-onap-application/pom.xml new file mode 100644 index 0000000..04fd2a2 --- /dev/null +++ b/sparkybe-onap-application/pom.xml @@ -0,0 +1,554 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.10.RELEASE + + + org.onap.aai.sparky-be + sparkybe-onap-application + 1.2.0-SNAPSHOT + jar + + + 1.8 + 0.7.9 + org.onap.aai + sparky-fe + 1.1.0-SNAPSHOT + 9517 + 8000 + https://nexus.onap.org + 2.20.0 + ${basedir}/ + + + + + + + + + + + org.apache.camel + camel-spring-boot-dependencies + ${camel-spring-boot.version} + pom + import + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.apache.camel + camel-restlet + ${camel-spring-boot.version} + + + commons-logging + commons-logging + + + + + + org.apache.camel + camel-servlet + ${camel-spring-boot.version} + + + commons-logging + commons-logging + + + + + + + org.apache.camel + camel-spring-boot-dependencies + ${camel-spring-boot.version} + pom + import + + + + + + + + org.apache.camel + camel-spring-boot-starter + + + + + org.apache.camel + camel-restlet + + + + commons-io + commons-io + 2.4 + + + + + org.eclipse.jetty + jetty-util + provided + + + + org.apache.camel + camel-servlet-starter + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.onap.aai.sparky-be + sparkybe-onap-service + 1.2.0-SNAPSHOT + + + + + + + + + + commons-cli + commons-cli + 1.2 + + + + + + + + + + + + com.google.guava + guava + 19.0 + + + + org.onap.aai.logging-service + common-logging + 1.2.0 + + + + dom4j + dom4j + provided + + + + org.eclipse.persistence + eclipselink + 2.6.2 + + + + org.slf4j + slf4j-api + provided + + + + com.fasterxml.jackson.core + jackson-core + provided + + + + org.onap.aai.aai-common + aai-schema + 1.2.0 + + + + org.onap.aai + rest-client + 1.2.0 + + + commons-io + commons-io + 2.4 + + + + + org.restlet.jee + org.restlet.ext.servlet + 2.1.1 + + + + + com.openpojo + openpojo + 0.8.6 + + + + com.google.code.gson + gson + provided + + + + + org.json + json + provided + + + + com.fasterxml.jackson.core + jackson-databind + provided + + + + org.onap.portal.sdk + epsdk-fw + 1.3.0 + + + commons-logging + commons-logging + + + log4j + log4j + + + log4j + apache-log4j-extras + + + org.slf4j + slf4j-log4j12 + + + + + + + + org.mockito + mockito-all + 1.10.19 + test + + + + org.powermock + powermock-module-junit4 + 1.6.2 + test + + + org.powermock + powermock-api-mockito + 1.6.2 + test + + + org.powermock + powermock-module-javaagent + 1.6.2 + test + + + org.powermock + powermock-module-junit4-rule-agent + 1.6.2 + test + + + + org.hamcrest + hamcrest-library + test + + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + copy-docker-file + package + + copy-resources + + + target + true + + + ${basedir}/src/main/docker + true + + **/* + + + + ${basedir}/src/main/scripts/ + + + + + + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + copy-docker-file + package + + copy-resources + + + target + true + + + ${basedir}/src/main/docker + true + + **/* + + + + ${basedir}/src/main/bin/ + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.0.0 + + + copy-installed + install + + copy + + + + + ${frontEndGroupdId} + ${frontEndArtifactId} + ${frontEndVersion} + war + ${basedir}/target/ + aai.war + + + + + + + + + org.jacoco + jacoco-maven-plugin + ${version.jacoco.maven.plugin} + + + prepare-agent + + prepare-agent + + + + report + package + + report + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.3 + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + + checkstyle + + + + + + + + + + + com.spotify + docker-maven-plugin + 0.4.11 + + true + docker-hub + ${docker.push.registry}/onap/${project.artifactId} + ${docker.location} + + latest + + true + + + + + com.mycila + license-maven-plugin + 3.0 + +
LICENSE
+ + src/main/java/** + +
+ + + + format + + process-sources + + +
+ +
+
+
+ + + diff --git a/project-configs/code-tools/sonar-secret.txt b/sparkybe-onap-application/project-configs/code-tools/sonar-secret.txt similarity index 100% rename from project-configs/code-tools/sonar-secret.txt rename to sparkybe-onap-application/project-configs/code-tools/sonar-secret.txt diff --git a/sparkybe-onap-application/src/main/config/ajsc-override-web.xml b/sparkybe-onap-application/src/main/config/ajsc-override-web.xml new file mode 100644 index 0000000..b8ff7da --- /dev/null +++ b/sparkybe-onap-application/src/main/config/ajsc-override-web.xml @@ -0,0 +1,13 @@ + + + + + + PortalRestAPIProxy + /api/v2/* + + + + \ No newline at end of file diff --git a/sparkybe-onap-application/src/main/config/runner-web.xml b/sparkybe-onap-application/src/main/config/runner-web.xml new file mode 100644 index 0000000..ca0c5e2 --- /dev/null +++ b/sparkybe-onap-application/src/main/config/runner-web.xml @@ -0,0 +1,14 @@ + + + + + + PortalRestAPIProxy + org.openecomp.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy + + + + + diff --git a/src/main/docker/Dockerfile b/sparkybe-onap-application/src/main/docker/Dockerfile similarity index 81% rename from src/main/docker/Dockerfile rename to sparkybe-onap-application/src/main/docker/Dockerfile index b97e621..d98110c 100644 --- a/src/main/docker/Dockerfile +++ b/sparkybe-onap-application/src/main/docker/Dockerfile @@ -15,13 +15,16 @@ RUN export JAVA_HOME # Build up the deployment folder structure RUN mkdir -p $MICRO_HOME -copy swm/package/nix/dist_files/appl/sparky-be/${project.version}/ $MICRO_HOME/ +RUN mkdir -p $BIN_HOME + +# copy swm/package/nix/dist_files/appl/sparky-be/${project.version}/ $MICRO_HOME/ RUN ls -la $BIN_HOME/ -RUN chmod 755 $BIN_HOME/* + +#RUN chmod 755 $BIN_HOME/* RUN ln -s /logs $MICRO_HOME/logs EXPOSE 8000 8000 CMD tail -F -n0 /etc/hosts -CMD /opt/app/sparky/bin/start.sh +#CMD /opt/app/sparky/bin/start.sh #CMD top diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java new file mode 100644 index 0000000..d6721b2 --- /dev/null +++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java @@ -0,0 +1,171 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +/** + * This copy of Woodstox XML processor is licensed under the + * Apache (Software) License, version 2.0 ("the License"). + * See the License for details about distribution rights, and the + * specific rights regarding derivate works. + * + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/ + * + * A copy is also included in the downloadable source code package + * containing Woodstox, in file "ASL2.0", under the same directory + * as this file. + */ +package org.onap.aai.sparky; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.servlet.CamelHttpTransportServlet; +import org.apache.camel.model.rest.RestBindingMode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; + +@SpringBootApplication +public class Application /*extends SpringBootServletInitializer */ { + + private @Autowired AutowireCapableBeanFactory beanFactory; + + public static void main(String[] args) { + + ApplicationContext applicationContext = SpringApplication.run(Application.class, args); + + /*for (String name : applicationContext.getBeanDefinitionNames()) { + System.out.println(name); + }*/ + + } + + /* @Component + class RestApi extends RouteBuilder { + + @Override + public void configure() { + + //restConfiguration().component("restlet").contextPath("/rs").bindingMode(RestBindingMode.json); + + + /*rest("/books").description("Books REST service") + .get("/").description("The list of all the books") + .route().routeId("books-api") + .bean(Database.class, "findBooks") + .endRest() + .get("order/{id}").description("Details of an order by id") + .route().routeId("order-api") + .bean(Database.class, "findOrder(${header.id})");*/ + /* } + }*/ + + + /* + * TODO: we need to figure out the initialization required for our restlets + */ + + /*@Bean + public ServletRegistrationBean restletBootstrapInitialization() { + + SpringServerServlet serverServlet = new SpringServerServlet(); + ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); + + + Map params = new HashMap(); + + params.put("org.restlet.component", "restletComponent"); + + regBean.setInitParameters(params); + + return regBean; + }*/ + + + + /* + * This initialization code enabled access to aai-ui-proxy-processor + */ + + @Bean + ServletRegistrationBean servletRegistrationBean() { + final ServletRegistrationBean servlet = + new ServletRegistrationBean(new CamelHttpTransportServlet(), "/rest/*"); + servlet.setName("CamelServlet"); + return servlet; + } + + /* @Bean + public EmbeddedServletContainerFactory servletContainerFactory() { + return new TomcatEmbeddedServletContainerFactory() { + + /* + * Stackoverflow solution for adding a WAR into our embedded tomcat runtime + * https://stackoverflow.com/questions/31374726/spring-boot-how-to-add-another-war-files-to-the-embedded-tomcat + */ + + + /* @Override + protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(Tomcat tomcat) { + // Ensure that the webapps directory exists + System.out.println("catalina base = " + tomcat.getServer().getCatalinaBase()); + new File(tomcat.getServer().getCatalinaBase(), "webapps").mkdirs(); + + try { + Context context = tomcat.addWebapp("/services/aai/webapp", "X:\\2018_dev\\OSEAAI\\NUC-7257-spring-boot-conversion\\onap_sparky-be\\src\\main\\resources\\extApps\\aai.war"); + + // Allow the webapp to load classes from your fat jar + context.setParentClassLoader(getClass().getClassLoader()); + } catch (ServletException ex) { + throw new IllegalStateException("Failed to add webapp", ex); + } + return super.getTomcatEmbeddedServletContainer(tomcat); + } + + }; + }*/ + + /** + * bind LoginFilter + */ + + /*@Bean + public FilterRegistrationBean myFilter() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + Filter myFilter = new LoginFilter(); + beanFactory.autowireBean(myFilter); + registration.setFilter(myFilter); + registration.addUrlPatterns("/*"); + return registration; + }*/ + + + + +} diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/PropertyConfigLoader.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/PropertyConfigLoader.java new file mode 100644 index 0000000..ddb697f --- /dev/null +++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/PropertyConfigLoader.java @@ -0,0 +1,34 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +@Configuration +@PropertySource("file:${CONFIG_HOME}/config/sparky-application.properties") +public class PropertyConfigLoader { + +} diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/SparkySpringXmlConfiguration.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/SparkySpringXmlConfiguration.java new file mode 100644 index 0000000..e12e72d --- /dev/null +++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/config/SparkySpringXmlConfiguration.java @@ -0,0 +1,46 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +/** + * This copy of Woodstox XML processor is licensed under the + * Apache (Software) License, version 2.0 ("the License"). + * See the License for details about distribution rights, and the + * specific rights regarding derivate works. + * + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/ + * + * A copy is also included in the downloadable source code package + * containing Woodstox, in file "ASL2.0", under the same directory + * as this file. + */ +package org.onap.aai.sparky.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; + +@Configuration +@ImportResource({"file:${CONFIG_HOME}/dynamic/spring-beans/*.xml"}) +public class SparkySpringXmlConfiguration {} diff --git a/sparkybe-onap-application/src/main/resources/banner.txt b/sparkybe-onap-application/src/main/resources/banner.txt new file mode 100644 index 0000000..c6081b2 --- /dev/null +++ b/sparkybe-onap-application/src/main/resources/banner.txt @@ -0,0 +1,8 @@ + _____ _ ____ ______ ____ _ _ _____ + / ____| | | | _ \| ____|_ / __ \| \ | | /\ | __ \ + | (___ _ __ __ _ _ __| | ___ _ ______| |_) | |__ (_) | | | | \| | / \ | |__) | + \___ \| '_ \ / _` | '__| |/ / | | |______| _ <| __| | | | | . ` | / /\ \ | ___/ + ____) | |_) | (_| | | | <| |_| | | |_) | |____ _ | |__| | |\ |/ ____ \| | + |_____/| .__/ \__,_|_| |_|\_\\__, | |____/|______(_) \____/|_| \_/_/ \_\_| + | | __/ | + |_| |___/ \ No newline at end of file diff --git a/sparkybe-onap-application/src/main/scripts/start.sh b/sparkybe-onap-application/src/main/scripts/start.sh new file mode 100644 index 0000000..514d7c5 --- /dev/null +++ b/sparkybe-onap-application/src/main/scripts/start.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +BASEDIR="/opt/app/sparky" +MICRO_HOME="$BASEDIR" +CONFIG_HOME=${MICRO_HOME}/config + +if [ -z "$CONFIG_HOME" ]; then + echo "CONFIG_HOME must be set in order to start up process" + exit 1 +fi + +PROPS="-DCONFIG_HOME=${CONFIG_HOME}" + +#echo $CLASSPATH + +set -x +exec java -Xms1024m -Xmx4096m $PROPS -jar ${MICRO_HOME}/sparky-be.jar --spring.config.name=sparky-be-application + + + + +#if [ -z "$KEY_STORE_PASSWORD" ]; then +# echo "KEY_STORE_PASSWORD must be set in order to start up process" +# exit 1 +#else +# sed -i /"KEY_STORE_PASSWORD"/d $AJSC_CONF_HOME/etc/sysprops/sys-props.properties +# echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties +#fi + +#if [ -z "$KEY_MANAGER_PASSWORD" ]; then +# echo "KEY_MANAGER_PASSWORD must be set in order to start up process" +# exit 1 +#else +# sed -i /"KEY_MANAGER_PASSWORD"/d $AJSC_CONF_HOME/etc/sysprops/sys-props.properties +# echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties +#fi + +#CLASSPATH="$AJSC_HOME/lib/ajsc-runner-2.0.0.jar" +#CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/" +#CLASSPATH="$CLASSPATH:$CONFIG_HOME/portal/" +#PROPS="-DAJSC_HOME=$AJSC_HOME" +#PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/" +#PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml" +#PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME" +#PROPS="$PROPS -DAJSC_EXTERNAL_LIB_FOLDERS=$AJSC_HOME/commonLibs" +#PROPS="$PROPS -DAJSC_EXTERNAL_PROPERTIES_FOLDERS=$AJSC_HOME/ajsc-shared-config/etc" +#PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=ajsc-tier-support-ui" +#PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1" +#PROPS="$PROPS -DSOACLOUD_SERVICE_VERSION=0.0.0" +#PROPS="$PROPS -Dserver.port=8000" +#PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" + +#echo $CLASSPATH + +#if [ "$UI_HTTPS_PORT" ]; then +# /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ sslport=$UI_HTTPS_PORT +#elif [ "$UI_HTTP_PORT" ]; then +# /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ port=$UI_HTTP_PORT +#fi diff --git a/sparkybe-onap-service/LICENSE b/sparkybe-onap-service/LICENSE new file mode 100644 index 0000000..c8636af --- /dev/null +++ b/sparkybe-onap-service/LICENSE @@ -0,0 +1,18 @@ +============LICENSE_START======================================================= +org.onap.aai +================================================================================ +Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. +Copyright © 2017-2018 Amdocs +================================================================================ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +============LICENSE_END========================================================= \ No newline at end of file diff --git a/sparkybe-onap-service/eclipse-config/eclipse-java-google-style.xml b/sparkybe-onap-service/eclipse-config/eclipse-java-google-style.xml new file mode 100644 index 0000000..03c2420 --- /dev/null +++ b/sparkybe-onap-service/eclipse-config/eclipse-java-google-style.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sparkybe-onap-service/pom.xml b/sparkybe-onap-service/pom.xml new file mode 100644 index 0000000..37c464f --- /dev/null +++ b/sparkybe-onap-service/pom.xml @@ -0,0 +1,555 @@ + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.10.RELEASE + + + org.onap.aai.sparky-be + sparkybe-onap-service + 1.2.0-SNAPSHOT + jar + + + 1.8 + 0.7.9 + org.onap.aai + sparky-fe + 1.1.0-SNAPSHOT + 9517 + 8000 + https://nexus.onap.org + 2.20.0 + ${basedir}/ + + + + + + + + + + + org.apache.camel + camel-spring-boot-dependencies + ${camel-spring-boot.version} + pom + import + + + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.apache.camel + camel-restlet + ${camel-spring-boot.version} + + + commons-logging + commons-logging + + + + + + org.apache.camel + camel-servlet + ${camel-spring-boot.version} + + + commons-logging + commons-logging + + + + + + + org.apache.camel + camel-spring-boot-dependencies + ${camel-spring-boot.version} + pom + import + + + + + + + + org.apache.camel + camel-spring-boot-starter + + + + + org.apache.camel + camel-restlet + + + + commons-io + commons-io + 2.4 + + + + + org.eclipse.jetty + jetty-util + provided + + + + org.apache.camel + camel-servlet-starter + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + commons-cli + commons-cli + 1.2 + + + + + + + + + + + + com.google.guava + guava + 19.0 + + + + + org.onap.aai.logging-service + common-logging + 1.2.0 + + + + + dom4j + dom4j + provided + + + + org.eclipse.persistence + eclipselink + 2.6.2 + + + + org.slf4j + slf4j-api + provided + + + + com.fasterxml.jackson.core + jackson-core + provided + + + + org.onap.aai.aai-common + aai-schema + 1.2.0 + + + + org.onap.aai + rest-client + 1.2.0 + + + + + commons-io + commons-io + 2.4 + + + + + org.restlet.jee + org.restlet.ext.servlet + 2.1.1 + + + + + com.openpojo + openpojo + 0.8.6 + + + + com.google.code.gson + gson + provided + + + + + org.json + json + provided + + + + com.fasterxml.jackson.core + jackson-databind + provided + + + + org.onap.portal.sdk + epsdk-fw + 1.3.0 + + + commons-logging + commons-logging + + + log4j + log4j + + + log4j + apache-log4j-extras + + + org.slf4j + slf4j-log4j12 + + + + + + + + org.mockito + mockito-all + 1.10.19 + test + + + + org.powermock + powermock-module-junit4 + 1.6.2 + test + + + org.powermock + powermock-api-mockito + 1.6.2 + test + + + org.powermock + powermock-module-javaagent + 1.6.2 + test + + + org.powermock + powermock-module-junit4-rule-agent + 1.6.2 + test + + + + org.hamcrest + hamcrest-library + test + + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + + + + + + + + + + + + org.jacoco + jacoco-maven-plugin + ${version.jacoco.maven.plugin} + + + prepare-agent + + prepare-agent + + + + report + package + + report + + + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.3 + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + + checkstyle + + + + + + + + + + + + + + com.mycila + license-maven-plugin + 3.0 + +
LICENSE
+ + src/main/java/** + +
+ + + + format + + process-sources + + +
+ +
+
+
+ + + diff --git a/sparkybe-onap-service/project-configs/code-tools/sonar-secret.txt b/sparkybe-onap-service/project-configs/code-tools/sonar-secret.txt new file mode 100644 index 0000000..9036e07 --- /dev/null +++ b/sparkybe-onap-service/project-configs/code-tools/sonar-secret.txt @@ -0,0 +1 @@ +7TP5jKdtMb+0EtW4Trbbnw== \ No newline at end of file diff --git a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java similarity index 71% rename from src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java index 941c1e5..be29889 100644 --- a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregatevnf.search; @@ -25,9 +29,9 @@ import java.util.ArrayList; import java.util.List; import javax.json.JsonObject; +import javax.servlet.http.HttpServletRequest; import org.apache.camel.Exchange; -import org.apache.camel.component.restlet.RestletConstants; import org.json.JSONArray; import org.json.JSONObject; import org.onap.aai.cl.api.Logger; @@ -35,49 +39,37 @@ import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.sparky.dal.ElasticSearchAdapter; import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.util.ServletUtils; import org.onap.aai.sparky.search.filters.FilterQueryBuilder; import org.onap.aai.sparky.search.filters.config.FiltersConfig; import org.onap.aai.sparky.search.filters.entity.SearchFilter; import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; public class AggregateSummaryProcessor { - private static final Logger LOG = - LoggerFactory.getInstance().getLogger(AggregateSummaryProcessor.class); + private static final Logger LOG = LoggerFactory.getInstance().getLogger(AggregateSummaryProcessor.class); private static final String KEY_FILTERS = "filters"; private ElasticSearchAdapter elasticSearchAdapter = null; - + private String vnfAggregationIndexName; private FiltersConfig filtersConfig; - - public AggregateSummaryProcessor(ElasticSearchAdapter elasticSearchAdapter, - FiltersConfig filtersConfig) { + + public AggregateSummaryProcessor(ElasticSearchAdapter elasticSearchAdapter, FiltersConfig filtersConfig) { this.elasticSearchAdapter = elasticSearchAdapter; this.filtersConfig = filtersConfig; } - + public void setVnfAggregationIndexName(String vnfAggregationIndexName) { this.vnfAggregationIndexName = vnfAggregationIndexName; } - + public void getFilteredAggregation(Exchange exchange) { - Response response = - exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - Request request = exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST, Request.class); - - /* - * Disables automatic Apache Camel Restlet component logging which prints out an undesirable log - * entry which includes client (e.g. browser) information - */ - request.setLoggable(false); + HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class); + ServletUtils.setUpMdcContext(exchange, request); + try { String payload = exchange.getIn().getBody(String.class); @@ -98,43 +90,42 @@ public class AggregateSummaryProcessor { if (parameters.has(KEY_FILTERS)) { requestFilters = parameters.getJSONArray(KEY_FILTERS); } else { - + JSONObject zeroResponsePayload = new JSONObject(); zeroResponsePayload.put("count", 0); - response.setStatus(Status.SUCCESS_OK); - response.setEntity(zeroResponsePayload.toString(), MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); - + //response.setStatus(Status.SUCCESS_OK); + //response.setEntity(zeroResponsePayload.toString(), MediaType.APPLICATION_JSON); + exchange.getOut().setBody(zeroResponsePayload.toString()); + LOG.error(AaiUiMsgs.ERROR_FILTERS_NOT_FOUND); return; } - + if (requestFilters != null && requestFilters.length() > 0) { List filtersToQuery = new ArrayList(); - for (int i = 0; i < requestFilters.length(); i++) { + for(int i = 0; i < requestFilters.length(); i++) { JSONObject filterEntry = requestFilters.getJSONObject(i); filtersToQuery.add(filterEntry); } - + String jsonResponsePayload = getVnfFilterAggregations(filtersToQuery); - response.setStatus(Status.SUCCESS_OK); - response.setEntity(jsonResponsePayload, MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); - + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200); + exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json"); + exchange.getOut().setBody(jsonResponsePayload); + } else { String emptyResponse = getEmptyAggResponse(); - response.setStatus(Status.SUCCESS_OK); - response.setEntity(emptyResponse, MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200); + exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json"); + exchange.getOut().setBody(emptyResponse); LOG.error(AaiUiMsgs.ERROR_FILTERS_NOT_FOUND); } } } catch (Exception exc) { - LOG.error(AaiUiMsgs.ERROR_GENERIC, - "FilterProcessor failed to get filter list due to error = " + exc.getMessage()); + LOG.error(AaiUiMsgs.ERROR_GENERIC, "FilterProcessor failed to get filter list due to error = " + exc.getMessage()); } } - + private String getEmptyAggResponse() { JSONObject aggPayload = new JSONObject(); aggPayload.put("totalChartHits", 0); @@ -143,65 +134,75 @@ public class AggregateSummaryProcessor { payload.append("groupby_aggregation", aggPayload); return payload.toString(); - } - + } + private static final String FILTER_ID_KEY = "filterId"; private static final String FILTER_VALUE_KEY = "filterValue"; private static final int DEFAULT_SHOULD_MATCH_SCORE = 1; private static final String VNF_FILTER_AGGREGATION = "vnfFilterAggregation"; + private String getVnfFilterAggregations(List filtersToQuery) throws IOException { - + List searchFilters = new ArrayList(); - for (JSONObject filterEntry : filtersToQuery) { - + for(JSONObject filterEntry : filtersToQuery) { + String filterId = filterEntry.getString(FILTER_ID_KEY); - if (filterId != null) { + if(filterId != null) { SearchFilter filter = new SearchFilter(); filter.setFilterId(filterId); - - if (filterEntry.has(FILTER_VALUE_KEY)) { + + if(filterEntry.has(FILTER_VALUE_KEY)) { String filterValue = filterEntry.getString(FILTER_VALUE_KEY); filter.addValue(filterValue); } - + searchFilters.add(filter); } } - + // Create query for summary by entity type - JsonObject vnfSearch = FilterQueryBuilder.createCombinedBoolAndAggQuery(filtersConfig, - searchFilters, DEFAULT_SHOULD_MATCH_SCORE); + JsonObject vnfSearch = FilterQueryBuilder.createCombinedBoolAndAggQuery(filtersConfig, searchFilters, DEFAULT_SHOULD_MATCH_SCORE); // Parse response for summary by entity type query OperationResult opResult = elasticSearchAdapter.doPost( elasticSearchAdapter.buildElasticSearchUrlForApi(vnfAggregationIndexName, SparkyConstants.ES_SEARCH_API), vnfSearch.toString(), javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE); - - return buildAggregateVnfResponseJson(opResult.getResult()); - + + if ( opResult.wasSuccessful()) { + return buildAggregateVnfResponseJson(opResult.getResult()); + } else { + return buildEmptyAggregateVnfResponseJson(); + } } + private String buildEmptyAggregateVnfResponseJson() { + JSONObject finalOutputToFe = new JSONObject(); + finalOutputToFe.put("total", 0); + return finalOutputToFe.toString(); + } + private String buildAggregateVnfResponseJson(String responseJsonStr) { - + JSONObject finalOutputToFe = new JSONObject(); JSONObject responseJson = new JSONObject(responseJsonStr); - + + JSONObject hits = responseJson.getJSONObject("hits"); int totalHits = hits.getInt("total"); finalOutputToFe.put("total", totalHits); - + JSONObject aggregations = responseJson.getJSONObject("aggregations"); String[] aggKeys = JSONObject.getNames(aggregations); JSONObject aggregationsList = new JSONObject(); - - for (String aggName : aggKeys) { + + for(String aggName : aggKeys) { JSONObject aggregation = aggregations.getJSONObject(aggName); JSONArray buckets = aggregation.getJSONArray("buckets"); aggregationsList.put(aggName, buckets); } - + finalOutputToFe.put("aggregations", aggregationsList); return finalOutputToFe.toString(); diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java new file mode 100644 index 0000000..6e7b456 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java @@ -0,0 +1,129 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.aggregatevnf.search; + +import java.util.ArrayList; +import java.util.List; + +import javax.json.JsonObject; +import javax.ws.rs.core.MediaType; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.aai.restclient.client.OperationResult; +import org.onap.aai.sparky.common.search.CommonSearchSuggestion; +import org.onap.aai.sparky.dal.ElasticSearchAdapter; +import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.search.api.SearchProvider; +import org.onap.aai.sparky.search.entity.QuerySearchEntity; +import org.onap.aai.sparky.search.entity.SearchSuggestion; +import org.onap.aai.sparky.search.filters.entity.UiFilterValueEntity; +import org.onap.aai.sparky.util.NodeUtils; +import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public class AggregateVnfSearchProvider implements SearchProvider { + + private static final Logger LOG = LoggerFactory.getInstance().getLogger(AggregateVnfSearchProvider.class); + + private ObjectMapper mapper; + private ElasticSearchAdapter elasticSearchAdapter = null; + private String autoSuggestIndexName; + private String vnfSearchSuggestionRoute; + + public AggregateVnfSearchProvider(ElasticSearchAdapter elasticSearchAdapter, + String autoSuggestIndexName, String vnfSearchSuggestionRoute) { + mapper = new ObjectMapper(); + this.elasticSearchAdapter = elasticSearchAdapter; + this.autoSuggestIndexName = autoSuggestIndexName; + this.vnfSearchSuggestionRoute = vnfSearchSuggestionRoute; + } + + public void setAutoSuggestIndexName(String autoSuggestIndexName) { + this.autoSuggestIndexName = autoSuggestIndexName; + } + + @Override + public List search(QuerySearchEntity queryRequest) { + + List returnList = new ArrayList(); + + try { + + /* Create suggestions query */ + JsonObject vnfSearch = VnfSearchQueryBuilder.createSuggestionsQuery(String.valueOf(queryRequest.getMaxResults()), queryRequest.getQueryStr()); + + /* Parse suggestions response */ + OperationResult opResult = elasticSearchAdapter.doPost( + elasticSearchAdapter.buildElasticSearchUrlForApi(autoSuggestIndexName, + SparkyConstants.ES_SUGGEST_API), + vnfSearch.toString(), MediaType.APPLICATION_JSON_TYPE); + + String result = opResult.getResult(); + + if (!opResult.wasSuccessful()) { + LOG.error(AaiUiMsgs.ERROR_PARSING_JSON_PAYLOAD_VERBOSE, result); + return returnList; + } + + JSONObject responseJson = new JSONObject(result); + String suggestionsKey = "vnfs"; + JSONArray suggestionsArray = new JSONArray(); + JSONArray suggestions = responseJson.getJSONArray(suggestionsKey); + if (suggestions.length() > 0) { + suggestionsArray = suggestions.getJSONObject(0).getJSONArray("options"); + for (int i = 0; i < suggestionsArray.length(); i++) { + JSONObject querySuggestion = suggestionsArray.getJSONObject(i); + if (querySuggestion != null) { + CommonSearchSuggestion responseSuggestion = new CommonSearchSuggestion(); + responseSuggestion.setText(querySuggestion.getString("text")); + responseSuggestion.setRoute(vnfSearchSuggestionRoute); + responseSuggestion.setHashId(NodeUtils.generateUniqueShaDigest(querySuggestion.getString("text"))); + + // Extract filter list from JSON and add to response suggestion + JSONObject payload = querySuggestion.getJSONObject("payload"); + if (payload.length() > 0) { + JSONArray filterList = payload.getJSONArray("filterList"); + for (int filter = 0; filter < filterList.length(); filter++) { + String filterValueString = filterList.getJSONObject(filter).toString(); + UiFilterValueEntity filterValue = mapper.readValue(filterValueString, UiFilterValueEntity.class); + responseSuggestion.getFilterValues().add(filterValue); + } + } + returnList.add(responseSuggestion); + } + } + } + } catch (Exception exc) { + LOG.error(AaiUiMsgs.ERROR_GENERIC, "Search failed due to error = " + exc.getMessage()); + } + + return returnList; + } + +} diff --git a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java index 8542c9a..2645433 100644 --- a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/VnfSearchQueryBuilder.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregatevnf.search; @@ -28,11 +32,13 @@ import javax.json.JsonArrayBuilder; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; + /** * Build a JSON payload to send to elastic search to get vnf search data. */ public class VnfSearchQueryBuilder { + /** * Creates the suggestions query. @@ -132,6 +138,8 @@ public class VnfSearchQueryBuilder { Json.createObjectBuilder().add("must", mustBlobBuilder))); } + + public static JsonObject createSummaryByEntityTypeQuery(Map attributes, String groupByKey) { JsonObjectBuilder jsonBuilder = Json.createObjectBuilder(); diff --git a/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java index d33dbed..8681853 100644 --- a/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSyncControllerFactory.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregation.sync; @@ -63,13 +67,16 @@ public class AggregationSyncControllerFactory implements SyncControllerRegistrar private NetworkStatisticsConfig aaiStatConfig; private NetworkStatisticsConfig esStatConfig; private OxmEntityLookup oxmEntityLookup; + private ElasticSearchSchemaFactory elasticSearchSchemaFactory; private List syncControllers; public AggregationSyncControllerFactory(ElasticSearchEndpointConfig esEndpointConfig, SyncControllerConfig syncControllerConfig, SyncControllerRegistry syncControllerRegistry, SuggestionEntityLookup suggestionEntityLookup, - OxmEntityLookup oxmEntityLookup) { + OxmEntityLookup oxmEntityLookup, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) { + this.elasticSearchSchemaFactory = elasticSearchSchemaFactory; this.syncControllers = new ArrayList(); this.elasticSearchEndpointConfig = esEndpointConfig; this.syncControllerConfig = syncControllerConfig; @@ -183,7 +190,7 @@ public class AggregationSyncControllerFactory implements SyncControllerRegistrar } IndexIntegrityValidator aggregationIndexValidator = new IndexIntegrityValidator(esAdapter, - schemaConfig, elasticSearchEndpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + schemaConfig, elasticSearchEndpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); aggregationSyncController.registerIndexValidator(aggregationIndexValidator); diff --git a/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java index e0b6955..a438215 100644 --- a/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/AggregationSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregation.sync; diff --git a/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java index a41df4f..9063e92 100644 --- a/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySummarizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregation.sync; diff --git a/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java index a9b36a9..eb42489 100644 --- a/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregation/sync/HistoricalEntitySyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.aggregation.sync; @@ -42,8 +46,8 @@ public class HistoricalEntitySyncController extends SyncControllerImpl ActiveInventoryAdapter aaiAdapter, ElasticSearchAdapter esAdapter, ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, int syncFrequencyInMinutes, NetworkStatisticsConfig aaiStatConfig, - NetworkStatisticsConfig esStatConfig, SearchableEntityLookup searchableEntityLookup) - throws Exception { + NetworkStatisticsConfig esStatConfig, SearchableEntityLookup searchableEntityLookup, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); // final String controllerName = "Historical Entity Count Synchronizer"; @@ -54,7 +58,7 @@ public class HistoricalEntitySyncController extends SyncControllerImpl setSyncFrequencyInMs(taskFrequencyInMs); IndexIntegrityValidator entityCounterHistoryValidator = new IndexIntegrityValidator(esAdapter, - schemaConfig, endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + schemaConfig, endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(entityCounterHistoryValidator); diff --git a/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java index 1ff38c8..8197398 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AbstractStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.analytics; diff --git a/src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java index 3e868f3..fd5f277 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/AveragingRingBuffer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.analytics; diff --git a/src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java index ab9fbca..ef78f9e 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/ComponentStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.analytics; diff --git a/src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java index c1fa9f1..55fb9d8 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistogramSampler.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.analytics; diff --git a/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java index 68305f8..1a534e3 100644 --- a/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/analytics/HistoricalCounter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.analytics; diff --git a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java index 071a5ef..05ce775 100644 --- a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutoSuggestionSyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.autosuggestion.sync; @@ -36,6 +40,7 @@ import org.onap.aai.sparky.sync.config.ElasticSearchEndpointConfig; import org.onap.aai.sparky.sync.config.ElasticSearchSchemaConfig; import org.onap.aai.sparky.sync.config.NetworkStatisticsConfig; import org.onap.aai.sparky.sync.config.SyncControllerConfig; +import org.springframework.beans.factory.annotation.Autowired; public class AutoSuggestionSyncController extends SyncControllerImpl implements SyncControllerRegistrar { @@ -46,13 +51,14 @@ public class AutoSuggestionSyncController extends SyncControllerImpl implements ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, NetworkStatisticsConfig aaiStatConfig, NetworkStatisticsConfig esStatConfig, OxmEntityLookup oxmEntityLookup, SuggestionEntityLookup suggestionEntityLookup, - FiltersConfig filtersConfig) throws Exception { + FiltersConfig filtersConfig, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); // final String controllerName = "Auto Suggestion Synchronizer"; IndexIntegrityValidator autoSuggestionIndexValidator = new IndexIntegrityValidator(esAdapter, - schemaConfig, endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + schemaConfig, endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(autoSuggestionIndexValidator); diff --git a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java index aad7bcb..baffa54 100644 --- a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.autosuggestion.sync; diff --git a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java index fe3ecd0..7226c27 100644 --- a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSuggestionSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.autosuggestion.sync; diff --git a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java index bfcceb2..f6504ad 100644 --- a/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/autosuggestion/sync/VnfAliasSyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.autosuggestion.sync; @@ -43,13 +47,14 @@ public class VnfAliasSyncController extends SyncControllerImpl implements SyncCo ActiveInventoryAdapter aaiAdapter, ElasticSearchAdapter esAdapter, ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, NetworkStatisticsConfig aaiStatConfig, NetworkStatisticsConfig esStatConfig, - FiltersConfig filtersConfig) throws Exception { + FiltersConfig filtersConfig, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); // final String controllerName = "VNFs Alias Suggestion Synchronizer"; IndexIntegrityValidator indexValidator = new IndexIntegrityValidator(esAdapter, schemaConfig, - endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(indexValidator); diff --git a/src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java index 0e662d1..624573f 100644 --- a/src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/common/search/CommonSearchSuggestion.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.common.search; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/SparkyResourceLoader.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/SparkyResourceLoader.java new file mode 100644 index 0000000..286b445 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/SparkyResourceLoader.java @@ -0,0 +1,125 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.config; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +import org.springframework.context.ResourceLoaderAware; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; + +public class SparkyResourceLoader implements ResourceLoaderAware { + + + private static final String FILE_URI = "file:"; + private ResourceLoader resourceLoader; + private String configHomeEnvVar; + + // private static Logger LOG = LoggerFactory.getInstance().getLogger(SparkyResourceLoader.class); + + @Override + public void setResourceLoader(ResourceLoader resourceLoader) { + this.resourceLoader = resourceLoader; + } + + public String getFullFileUri(String uriFilePath) { + return FILE_URI + System.getProperty(configHomeEnvVar) + uriFilePath; + } + + public String getAbsolutePath(String uriFilePath) { + return System.getProperty(configHomeEnvVar) + uriFilePath; + } + + protected Resource getResource(String uriFilePath, boolean isRelative) { + + String fileUri = uriFilePath; + + if (!uriFilePath.startsWith("file:")) { + fileUri = "file:" + uriFilePath; + } + + if (isRelative) { + return resourceLoader.getResource(getFullFileUri(fileUri)); + } else { + return resourceLoader.getResource(fileUri); + } + + } + + public File getResourceAsFile(String uriFilePath, boolean isRelativePath) throws IOException { + + Resource resource = getResource(uriFilePath, isRelativePath); + + if (resource.exists()) { + return resource.getFile(); + } + + return null; + + } + + public byte[] getResourceAsBytes(String uriFilePath, boolean isRelativePath) throws IOException { + + Resource resource = getResource(uriFilePath, isRelativePath); + + if (resource.exists()) { + return getResourceAsBytes(resource); + } + + return null; + } + + public byte[] getResourceAsBytes(Resource resource) throws IOException { + + if ( resource != null && resource.exists()) { + return Files.readAllBytes(Paths.get(resource.getFile().getAbsolutePath())); + } + + return null; + } + + public String getResourceAsString(String uriFilePath, boolean isRelativePath) throws IOException { + + Resource resource = getResource(uriFilePath, isRelativePath); + + if (resource.exists()) { + return new String(getResourceAsBytes(resource)); + } + + return null; + } + + public String getConfigHomeEnvVar() { + return configHomeEnvVar; + } + + public void setConfigHomeEnvVar(String configHomeEnvVar) { + this.configHomeEnvVar = configHomeEnvVar; + } + +} diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java index 28bc91c..d632c5a 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReference.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java index 581ddb7..c44b1f4 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java index 837503a..603b93d 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceLookup.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java index f53e589..4e995a5 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java index 29ed570..1e61345 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoEntityLookup.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java index 9341d7b..03fb9d6 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java index de2b893..fd071d1 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java index d99de4c..09326a8 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmEntityLookup.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java index 02ce01a..475fe8f 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelLoader.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java new file mode 100644 index 0000000..9e250b7 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java @@ -0,0 +1,33 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.config.oxm; + +import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; + +public interface OxmModelProcessor { + + public void processOxmModel(DynamicJAXBContext jaxbContext); + +} diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java index e1e37f4..7833ee0 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableEntityLookup.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java index 7c73344..9f2809f 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SearchableOxmEntityDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java index e4fdac4..774f6b0 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java index 2901763..fde1b6a 100644 --- a/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/config/oxm/SuggestionEntityLookup.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.config.oxm; diff --git a/src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java similarity index 99% rename from src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java index d95e507..604c74c 100644 --- a/src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.crossentityreference.sync; diff --git a/src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java index 9d33a3b..dded79f 100644 --- a/src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ActiveInventoryAdapter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal; diff --git a/src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java index 3072b91..3f5a273 100644 --- a/src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/ElasticSearchAdapter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal; diff --git a/src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java similarity index 96% rename from src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java index 86573d2..4ceb0d6 100644 --- a/src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/GizmoAdapter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal; diff --git a/src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java index 61f2e0a..0fc4a4e 100644 --- a/src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/NetworkTransaction.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal; diff --git a/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java index 3e79619..5ec7318 100644 --- a/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryEntityStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.aai; diff --git a/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java index f883634..b05b12c 100644 --- a/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/aai/ActiveInventoryProcessingExceptionStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.aai; diff --git a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java index 8226a25..0d46c2a 100644 --- a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/elasticsearch/ElasticSearchEntityStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.elasticsearch; diff --git a/src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java index 6c2da6e..5ad7fd0 100644 --- a/src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/exception/ElasticSearchOperationException.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.exception; diff --git a/src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java index 23bfe88..bae0784 100644 --- a/src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.proxy.processor; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java new file mode 100644 index 0000000..a891d20 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java @@ -0,0 +1,33 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.dal.rest; + + +/** + * The Enum HttpMethod. + */ +public enum HttpMethod { + GET, PUT, POST, DELETE, PATCH, HEAD +} diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java new file mode 100644 index 0000000..830e624 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java @@ -0,0 +1,38 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.dal.rest; + +public class RestClientConstructionException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public RestClientConstructionException(String message) { + super(message); + } + +} diff --git a/src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java index 8b7e881..30e48b7 100644 --- a/src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestClientFactory.java @@ -1,29 +1,33 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.rest; import org.onap.aai.restclient.client.RestClient; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig; import org.onap.aai.sparky.util.Encryptor; -import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; public class RestClientFactory { @@ -40,16 +44,17 @@ public class RestClientFactory { "Failed to build RestClient because RestAuthenticationMode is null."); } + SparkyResourceLoader resourceLoader = restEndpointConfig.getResourceLoader(); + switch (restEndpointConfig.getRestAuthenticationMode()) { case SSL_CERT: { Encryptor enc = new Encryptor(); - String certFileNameFullPath = - SparkyConstants.CONFIG_AUTH_LOCATION + restEndpointConfig.getCertFileName(); + String certFileNameFullPath = resourceLoader.getAbsolutePath(restEndpointConfig.getCertFileName()); String decryptedCertPassword = enc.decryptValue(restEndpointConfig.getCertPassword()); String truststoreFileNameFullPath = - SparkyConstants.CONFIG_AUTH_LOCATION + restEndpointConfig.getTruststoreFileName(); + resourceLoader.getAbsolutePath(restEndpointConfig.getTruststoreFileName()); return new RestClient() // .authenticationMode(restEndpointConfig.getRestAuthenticationMode()) // diff --git a/src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java index 606c279..dde68b8 100644 --- a/src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/RestOperationalStatistics.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.rest; diff --git a/src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java index d30e5e7..8859f02 100644 --- a/src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfig.java @@ -1,26 +1,31 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.dal.rest.config; import org.onap.aai.restclient.enums.RestAuthenticationMode; +import org.onap.aai.sparky.config.SparkyResourceLoader; public class RestEndpointConfig { @@ -37,6 +42,7 @@ public class RestEndpointConfig { private String truststoreFileName; private boolean validateServerCertChain; private boolean validateServerHostname; + private SparkyResourceLoader resourceLoader; public boolean isValidateServerCertChain() { return validateServerCertChain; @@ -142,6 +148,14 @@ public class RestEndpointConfig { this.truststoreFileName = truststoreFileName; } + public SparkyResourceLoader getResourceLoader() { + return resourceLoader; + } + + public void setResourceLoader(SparkyResourceLoader resourceLoader) { + this.resourceLoader = resourceLoader; + } + @Override public String toString() { return "RestEndpointConfig [" diff --git a/src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java index fbdbb94..8b35d7c 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeEditProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes; diff --git a/src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java index 79b5466..5d71135 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/AttributeUpdater.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes; diff --git a/src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java index 170ed5f..a5c251e 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserAuthorizationReader.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes; diff --git a/src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java index 83b3932..8999105 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/UserValidator.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes; diff --git a/src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java index eb34eab..0e8ce17 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/entity/EditRequest.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes.entity; diff --git a/src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java index 8ce56bd..119d680 100644 --- a/src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/editattributes/exception/AttributeUpdateException.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.editattributes.exception; diff --git a/src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java index a7f372a..a2039b4 100644 --- a/src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilder.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.inventory; diff --git a/src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java index 9c1f226..a0e0630 100644 --- a/src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/GeoVisualizationProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.inventory; diff --git a/src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java index 9f775e5..86918ad 100644 --- a/src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/GeoIndexDocument.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.inventory.entity; diff --git a/src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java index 88d47ba..ac89c6b 100644 --- a/src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/inventory/entity/TopographicalEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.inventory.entity; diff --git a/src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java index c86f5b1..7ae73a1 100644 --- a/src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/AaiUiMsgs.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.logging; diff --git a/src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java similarity index 77% rename from src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java index 1a7d90c..04ad83a 100644 --- a/src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/LoggingUtils.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.logging.util; diff --git a/src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java similarity index 74% rename from src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java index 9108d5e..44068a1 100644 --- a/src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/logging/util/ServletUtils.java @@ -1,34 +1,48 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.logging.util; import java.io.IOException; import java.io.PrintWriter; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.camel.Exchange; import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.mdc.MdcContext; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.sparky.logging.AaiUiMsgs; import org.onap.aai.sparky.search.SearchServiceAdapter; +import org.onap.aai.sparky.util.NodeUtils; +import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; +import org.slf4j.MDC; /** * The Class ServletUtils. @@ -155,4 +169,36 @@ public class ServletUtils { final String port = ePort; return String.format("http://%s:%s%s", host, port, resourceUrl); } + + public static void setUpMdcContext(final Exchange exchange, final HttpServletRequest request) { + + String txnId; + + Object xTransactionId = exchange.getIn().getHeader("X-TransactionId"); + if (xTransactionId == null) { + txnId = NodeUtils.getRandomTxnId(); + } else { + txnId = (String) xTransactionId; + } + + String fromAppId; + + Object partnerName = exchange.getIn().getHeader("X-FromAppId"); + if (partnerName == null) { + fromAppId = SparkyConstants.APP_NAME; + } else { + fromAppId = (String) partnerName; + } + + MdcContext.initialize(txnId, "AAI-UI", "", fromAppId, + request.getRequestURI() + ":" + request.getLocalPort()); + } + + public static Map> getTxnHeaders() { + Map> headers = new HashMap>(); + headers.put("X-TransactionId", Arrays.asList(MDC.get(MdcContext.MDC_REQUEST_ID))); + headers.put("X-FromAppId", Arrays.asList(MDC.get(MdcContext.MDC_PARTNER_NAME))); + return headers; + } + } diff --git a/src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java index ad651c7..4c393e1 100644 --- a/src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityCountHistoryProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; diff --git a/src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java index c24cef6..b36753e 100644 --- a/src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummary.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; diff --git a/src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java similarity index 76% rename from src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java index 03aa997..9568232 100644 --- a/src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/EntityTypeSummaryBucket.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; diff --git a/src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java similarity index 78% rename from src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java index 3ae7ec6..c790bb1 100644 --- a/src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchEntityProperties.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; diff --git a/src/main/java/org/onap/aai/sparky/search/SearchResponse.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchResponse.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/search/SearchResponse.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchResponse.java index b86c54c..201c154 100644 --- a/src/main/java/org/onap/aai/sparky/search/SearchResponse.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchResponse.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; diff --git a/src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java index d4fc11f..d37997a 100644 --- a/src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/SearchServiceAdapter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; @@ -42,7 +46,6 @@ import org.slf4j.MDC; public class SearchServiceAdapter { private static final String VALUE_QUERY = "query"; - private static final String SUGGEST_QUERY = "suggest"; private RestClient client; private RestEndpointConfig endpointConfig; @@ -125,17 +128,6 @@ public class SearchServiceAdapter { public String buildSearchServiceQueryUrl(String indexName) { return buildSearchServiceUrlForApi(indexName, VALUE_QUERY); } - - /** - * Get Full URL for search - * - * @param api the api - * @param indexName - * @return the full url - */ - public String buildSuggestServiceQueryUrl(String indexName) { - return buildSearchServiceUrlForApi(indexName, SUGGEST_QUERY); - } public String buildSearchServiceUrlForApi(String indexName, String api) { return String.format("https://%s:%s/services/search-data-service/%s/search/indexes/%s/%s", diff --git a/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java similarity index 64% rename from src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java index b6c47a6..dfe9016 100644 --- a/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/UnifiedSearchProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search; @@ -27,29 +31,25 @@ import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; +import javax.servlet.http.HttpServletRequest; + import org.apache.camel.Exchange; -import org.apache.camel.component.restlet.RestletConstants; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.cl.mdc.MdcContext; import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.util.ServletUtils; import org.onap.aai.sparky.search.api.SearchProvider; import org.onap.aai.sparky.search.entity.QuerySearchEntity; import org.onap.aai.sparky.search.entity.SearchSuggestion; import org.onap.aai.sparky.search.registry.SearchProviderRegistry; import org.onap.aai.sparky.util.NodeUtils; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.ClientInfo; -import org.restlet.data.MediaType; -import org.restlet.data.Status; import com.fasterxml.jackson.databind.ObjectMapper; public class UnifiedSearchProcessor { protected static final String HASH_ID_KEY = "hashId"; - + private static final Logger LOG = LoggerFactory.getInstance().getLogger(UnifiedSearchProcessor.class); @@ -61,7 +61,7 @@ public class UnifiedSearchProcessor { mapper = new ObjectMapper(); this.useOrderedSearchProviderKeys = false; } - + public boolean isUseOrderedSearchProviderKeys() { return useOrderedSearchProviderKeys; } @@ -71,47 +71,28 @@ public class UnifiedSearchProcessor { } public void search(Exchange exchange) { - - Object xTransactionId = exchange.getIn().getHeader("X-TransactionId"); - if (xTransactionId == null) { - xTransactionId = NodeUtils.getRandomTxnId(); - } - - Object partnerName = exchange.getIn().getHeader("X-FromAppId"); - if (partnerName == null) { - partnerName = "Browser"; - } - - Request request = exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST, Request.class); - - /* Disables automatic Apache Camel Restlet component logging which prints out an undesirable log entry - which includes client (e.g. browser) information */ - request.setLoggable(false); - - ClientInfo clientInfo = request.getClientInfo(); - MdcContext.initialize((String) xTransactionId, "AAI-UI", "", (String) partnerName, - clientInfo.getAddress() + ":" + clientInfo.getPort()); + HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class); + ServletUtils.setUpMdcContext(exchange, request); SearchResponse searchResponse = new SearchResponse(); long processTime = System.currentTimeMillis(); int totalAdded = 0; try { + String payload = exchange.getIn().getBody(String.class); - + if (payload == null || payload.isEmpty()) { LOG.error(AaiUiMsgs.SEARCH_SERVLET_ERROR, "Request Payload is empty"); - - /* - * Don't throw back an error, just return an empty set - */ + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 404); + return; } else { QuerySearchEntity searchRequest = mapper.readValue(payload, QuerySearchEntity.class); int maxResultsPerSearch = Integer.valueOf(searchRequest.getMaxResults()); - + Map> searchProviderSuggestions = new HashMap>(); @@ -124,17 +105,17 @@ public class UnifiedSearchProcessor { } /* - * Using ordered search provider keys allows us to deterministically calculate how many results - * from each provider should be returned. At the moment, this behavior is primarily only beneficial - * to test classes. As there is a cost to sorted-collections in the call processing path, this behavior - * has been made optional. + * Using ordered search provider keys allows us to deterministically calculate how many + * results from each provider should be returned. At the moment, this behavior is primarily + * only beneficial to test classes. As there is a cost to sorted-collections in the call + * processing path, this behavior has been made optional. */ - + if (useOrderedSearchProviderKeys) { searchProviderSuggestions = new TreeMap>(searchProviderSuggestions); } - + if (totalSuggestionsFromProviders > 0) { int suggestionIndex = 0; @@ -142,8 +123,7 @@ public class UnifiedSearchProcessor { Set>> searchProviderResults = searchProviderSuggestions.entrySet(); - while (totalAdded < maxResultsPerSearch - && (totalAdded < totalSuggestionsFromProviders)) { + while (totalAdded < maxResultsPerSearch && (totalAdded < totalSuggestionsFromProviders)) { for (Entry> searchProviderResultList : searchProviderResults) { @@ -167,25 +147,36 @@ public class UnifiedSearchProcessor { } searchResponse.addToTotalFound(totalAdded); - String searchResponseJson = NodeUtils.convertObjectToJson(searchResponse, true); processTime = System.currentTimeMillis() - processTime; searchResponse.setProcessingTimeInMs(processTime); - - Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - response.setStatus(Status.SUCCESS_OK); - response.setEntity(searchResponseJson, MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); + String searchResponseJson = NodeUtils.convertObjectToJson(searchResponse, true); + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200); + exchange.getOut().setBody(searchResponseJson); } catch (Exception exc) { - LOG.error(AaiUiMsgs.SEARCH_SERVLET_ERROR, - "Query search failed with error = " + exc.getMessage()); + LOG.error(AaiUiMsgs.ERROR_PROCESSING_REQUEST, exc); + + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); exchange.getOut().setBody( - generateJsonErrorResponse("Error while building response. Error = " + exc.getMessage()), + ServletUtils.generateJsonErrorResponse("Processing error = " + exc.getMessage()), String.class); + + } finally { + /* + * Restore the txnId + appId from the current thread local via the MdcContext + */ + + ServletUtils.getTxnHeaders().forEach((key, value) -> { + exchange.getOut().setHeader(key, value); + }); + + exchange.getOut().setHeader("RequestUrl", request.getRequestURI()); + exchange.getOut().setHeader("RequestPort", request.getLocalPort()); + } } - + public SearchProviderRegistry getSearchProviderRegistry() { return searchProviderRegistry; } @@ -194,15 +185,4 @@ public class UnifiedSearchProcessor { this.searchProviderRegistry = searchProviderRegistry; } - - /* - * This is the manual approach, however we could also create an object container for the error - * then use the Jackson ObjectWrite to dump the object to json instead. If it gets any more - * complicated we could do that approach so we don't have to manually trip over the JSON - * formatting. - */ - protected String generateJsonErrorResponse(String message) { - return String.format("{ \"errorMessage\" : %s }", message); - } - } diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java new file mode 100644 index 0000000..923c4d6 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java @@ -0,0 +1,36 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.search.api; + +import java.util.List; + +import org.onap.aai.sparky.search.entity.QuerySearchEntity; +import org.onap.aai.sparky.search.entity.SearchSuggestion; + +public interface SearchProvider { + + List search(QuerySearchEntity queryRequest); + +} diff --git a/src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java index 854c62d..070f305 100644 --- a/src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/config/SuggestionConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.config; diff --git a/src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java index e2b5820..37059fb 100644 --- a/src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/QuerySearchEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.entity; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java new file mode 100644 index 0000000..4529af5 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java @@ -0,0 +1,39 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.search.entity; + +public interface SearchSuggestion { + public String getHashId(); + + public void setHashId(String hashId); + + public String getRoute(); + + public void setRoute(String route); + + public String getText(); + + public void setText(String searchText); +} diff --git a/src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java index 707f907..3a01e2b 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterElasticSearchAdapter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java similarity index 70% rename from src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java index ebc2457..9d404a9 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters; @@ -24,19 +28,16 @@ import java.util.ArrayList; import java.util.List; import javax.json.JsonObject; +import javax.servlet.http.HttpServletRequest; import org.apache.camel.Exchange; -import org.apache.camel.component.restlet.RestletConstants; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.util.ServletUtils; import org.onap.aai.sparky.search.filters.entity.UiFilterEntity; import org.onap.aai.sparky.search.filters.entity.UiFiltersEntity; import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -65,13 +66,9 @@ public class FilterProcessor { } public void getFiltersWithValues(Exchange exchange) { - Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - Request request = exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST, Request.class); - - /* Disables automatic Apache Camel Restlet component logging which prints out an undesirable log entry - which includes client (e.g. browser) information */ - request.setLoggable(false); + + HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class); + ServletUtils.setUpMdcContext(exchange, request); UiFiltersEntity viewFiltersList = null; boolean wasErrorDuringFilterDiscovery = false; @@ -94,7 +91,14 @@ public class FilterProcessor { } } catch(Exception exc) { LOG.error(AaiUiMsgs.ERROR_GENERIC, "FilterProcessor failed to get filter list due to error = " + exc.getMessage()); - wasErrorDuringFilterDiscovery = true; + + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); + + exchange.getOut().setBody( + ServletUtils.generateJsonErrorResponse("FilterProcessor failed to get filter list due to error = " + exc.getMessage()), + String.class); + + return; } boolean wasErrorDuringValueSearch = false; @@ -110,24 +114,30 @@ public class FilterProcessor { UiFiltersEntity responseFiltersList = filteredSearchHelper.doFilterEnumeration(filterIds); JsonObject finalResponse = UiFiltersEntityConverter.convertUiFiltersEntityToUnifiedFilterResponse(responseFiltersList); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(finalResponse.toString(), MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200); + exchange.getOut().setBody(finalResponse.toString()); } else { wasErrorDuringValueSearch = true; } } catch(Exception exc) { LOG.error(AaiUiMsgs.ERROR_GENERIC, "FilterProcessor failed to generate valid unifiedFilterRequest response due to error, " + exc.getMessage()); - response.setStatus(Status.SERVER_ERROR_INTERNAL); + + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); + + exchange.getOut().setBody( + ServletUtils.generateJsonErrorResponse("FilterProcessor failed to generate valid unifiedFilterRequest response due to error = " + exc.getMessage()), + String.class); + + return; } } // In the case of an error we want to respond with a valid empty response if(wasErrorDuringFilterDiscovery || wasErrorDuringValueSearch) { - response.setStatus(Status.SUCCESS_OK); - response.setEntity(UiFiltersEntityConverter.generateEmptyResponse().toString(), MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); + //response.setStatus(Status.SUCCESS_OK); + //response.setEntity(UiFiltersEntityConverter.generateEmptyResponse().toString(), MediaType.APPLICATION_JSON); + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 404); + exchange.getOut().setBody(UiFiltersEntityConverter.generateEmptyResponse().toString()); } } diff --git a/src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java similarity index 96% rename from src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java index 26e6997..41a7b91 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterQueryBuilder.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java index d3fd7fe..0e981b4 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilteredSearchHelper.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java index b1b9249..46f62ac 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/UiFiltersEntityConverter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java similarity index 59% rename from src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java index 726ab12..3aded85 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; @@ -24,8 +28,8 @@ import java.io.File; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.logging.AaiUiMsgs; -import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; import com.fasterxml.jackson.databind.ObjectMapper; @@ -35,44 +39,40 @@ public class FiltersConfig { private String filtersFileName; - private String filterMappingsFileName; + private String viewsFileName; private FiltersForViewsConfig viewsConfig; private FiltersDetailsConfig filtersConfig; - - /** - * Instantiates a new UiViewFilterConfig. - */ + + private SparkyResourceLoader resourceLoader; + public FiltersConfig() { - initializeFilters(); + //exposed for testing } - public FiltersConfig(String filtersFileName, String filterMappingsFileName) { + public FiltersConfig(String filtersFileName, String viewsFileName, SparkyResourceLoader resourceLoader) { this.filtersFileName = filtersFileName; - this.filterMappingsFileName = filterMappingsFileName; - - viewsConfig = this.readUiViewsConfig(); - filtersConfig = this.readUiFiltersConfig(); - } + this.viewsFileName = viewsFileName; + this.resourceLoader = resourceLoader; + initializeFilters(); + } + /** * Initialize config. */ private void initializeFilters() { - filtersFileName = SparkyConstants.FILTER_LIST_FILE_DEFAULT; - filterMappingsFileName = SparkyConstants.FILTER_MAPPING_FILE_DEFAULT; - viewsConfig = this.readUiViewsConfig(); filtersConfig = this.readUiFiltersConfig(); } - public String getFilterMappingsFileName() { - return filterMappingsFileName; + public String getViewsFileName() { + return viewsFileName; } - public void setFilterMappingsFileName(String filterMappingsFileName) { - this.filterMappingsFileName = filterMappingsFileName; + public void setViewsFileName(String viewsFileName) { + this.viewsFileName = viewsFileName; } public String getFiltersFileName() { @@ -112,10 +112,10 @@ public class FiltersConfig { public FiltersDetailsConfig readUiFiltersConfig() { ObjectMapper mapper = new ObjectMapper(); FiltersDetailsConfig filtersConfig = null; - try{ - filtersConfig = mapper.readValue(new File(this.getFiltersFileName()), FiltersDetailsConfig.class); + try{ + filtersConfig = mapper.readValue(resourceLoader.getResourceAsFile(this.getFiltersFileName(),true), FiltersDetailsConfig.class); } catch (Exception e){ - LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, SparkyConstants.getConfigPath(this.getFiltersFileName())); + LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, this.getFiltersFileName()); } return filtersConfig; @@ -126,12 +126,33 @@ public class FiltersConfig { FiltersForViewsConfig viewsConfig = null; try { - viewsConfig = mapper.readValue(new File(this.getFilterMappingsFileName()), FiltersForViewsConfig.class); + viewsConfig = mapper.readValue(resourceLoader.getResourceAsFile(this.getViewsFileName(),true), FiltersForViewsConfig.class); } catch (Exception e){ - LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, SparkyConstants.getConfigPath(this.getFilterMappingsFileName())); + LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, this.getViewsFileName()); } return viewsConfig; } + + public void initializeFiltersDetailsConfig(File filtersFile) { + ObjectMapper mapper = new ObjectMapper(); + try{ + this.filtersConfig = mapper.readValue(filtersFile, FiltersDetailsConfig.class); + } catch (Exception e){ + LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, filtersFile.getAbsolutePath()); + } + } + + public void initializeFiltersForViewsConfig(File viewsFile) { + ObjectMapper mapper = new ObjectMapper(); + + try { + this.viewsConfig = mapper.readValue(viewsFile, FiltersForViewsConfig.class); + } catch (Exception e){ + LOG.error(AaiUiMsgs.ERROR_READING_JSON_SCHEMA, viewsFile.getAbsolutePath()); + } + + } + } diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java index 49c2092..ab5e1d4 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java index 5dd20cc..1d0adfe 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java index 8c049ee..d3ef9ba 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java index 7df4ccd..4f9e2da 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java index be76908..2f955fc 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java index 3310943..cf45d21 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java index b6d8e46..1d70314 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.config; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java index 5b0cc2f..3fc61ac 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/AggregationEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java index 0c1706d..750270a 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/BoolQueryBuilder.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java index 12129a0..fa9226e 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/FilteredAggregationQueryBuilder.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java index 3be780a..68c058b 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/MatchFilterCriteriaEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java index 55a490f..2a6f05d 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/SearchFilter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java index 30e2c70..f90403c 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java index 9d9f2ff..73b105b 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFilterValueEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java index ffd38e6..7780418 100644 --- a/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/entity/UiFiltersEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.filters.entity; diff --git a/src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java index babd146..4e785ce 100644 --- a/src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/registry/SearchProviderRegistry.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.search.registry; diff --git a/src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java index 742c4f0..9dfb1bf 100644 --- a/src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/BaseCookieDecryptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java new file mode 100644 index 0000000..6e79b60 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java @@ -0,0 +1,31 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.security; + +public interface CookieDecryptor { + + String decryptCookie(String encryptedCookie); + +} diff --git a/src/main/java/org/onap/aai/sparky/security/EcompSso.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/EcompSso.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/security/EcompSso.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/EcompSso.java index d248df9..3348b1f 100644 --- a/src/main/java/org/onap/aai/sparky/security/EcompSso.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/EcompSso.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security; diff --git a/src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java index ea910a6..f251c31 100644 --- a/src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactory.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security; diff --git a/src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java index e20e113..c09fa97 100644 --- a/src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/SecurityContextFactoryImpl.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security; diff --git a/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java similarity index 96% rename from src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java index 712051d..795739b 100644 --- a/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.filter; @@ -140,7 +144,7 @@ public class CspCookieFilter implements Filter { * @throws IOException if the properties failed to load. */ private void setConfigurationProperties(FilterConfig filterConfig) throws IOException { - InputStream inputStream = new FileInputStream(SparkyConstants.STATIC_CONFIG_APP_LOCATION + InputStream inputStream = new FileInputStream(SparkyConstants.CONFIG_HOME + filterConfig.getInitParameter(FILTER_PARAMETER_CONFIG)); Properties cspProperties = new Properties(); cspProperties.load(inputStream); diff --git a/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java similarity index 96% rename from src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java index c566e14..dd90573 100644 --- a/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/LoginFilter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.filter; diff --git a/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java index 67fee73..ad64c63 100644 --- a/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/PortalRestAPIServiceImpl.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.portal; diff --git a/src/main/java/org/onap/aai/sparky/security/portal/UserManager.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/UserManager.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/security/portal/UserManager.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/UserManager.java index b19ef98..ea9b204 100644 --- a/src/main/java/org/onap/aai/sparky/security/portal/UserManager.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/UserManager.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.portal; diff --git a/src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java index cf78614..e1b7eda 100644 --- a/src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/PortalAuthenticationConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.portal.config; diff --git a/src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java index a107122..283834c 100644 --- a/src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/portal/config/RolesConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.security.portal.config; diff --git a/src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java similarity index 52% rename from src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java index de8b471..a8dd131 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/SubscriptionServiceProcessor.java @@ -1,39 +1,38 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription; +import javax.servlet.http.HttpServletRequest; + import org.apache.camel.Exchange; -import org.apache.camel.component.restlet.RestletConstants; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.cl.mdc.MdcContext; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.util.ServletUtils; import org.onap.aai.sparky.subscription.services.SubscriptionService; -import org.onap.aai.sparky.util.NodeUtils; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.ClientInfo; -import org.restlet.data.MediaType; -import org.restlet.data.Status; public class SubscriptionServiceProcessor { @@ -51,52 +50,25 @@ public class SubscriptionServiceProcessor { public void getSubscription(Exchange exchange) { - - Object xTransactionId = exchange.getIn().getHeader("X-TransactionId"); - if (xTransactionId == null) { - xTransactionId = NodeUtils.getRandomTxnId(); - } - - Object partnerName = exchange.getIn().getHeader("X-FromAppId"); - if (partnerName == null) { - partnerName = "Browser"; - } - - Request request = exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST, Request.class); - - /* - * Disables automatic Apache Camel Restlet component logging which prints out an undesirable log - * entry which includes client (e.g. browser) information - */ - request.setLoggable(false); - - ClientInfo clientInfo = request.getClientInfo(); - MdcContext.initialize((String) xTransactionId, "AAI-UI", "", (String) partnerName, - clientInfo.getAddress() + ":" + clientInfo.getPort()); - - Response response = - exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class); + ServletUtils.setUpMdcContext(exchange, request); OperationResult subscriptionResult = null; - Status responseStatus = null; try { subscriptionResult = subService.buildSubscriptionPayload(); - responseStatus = Status.SUCCESS_OK; - + } catch (Exception exc) { - responseStatus = Status.SERVER_ERROR_INTERNAL; subscriptionResult = new OperationResult(); subscriptionResult.setResult(EMPTY_RESPONSE); LOG.error(AaiUiMsgs.FAILURE_TO_PROCESS_REQUEST, "Exception thrown during subscription processing: " + exc.getLocalizedMessage()); } - - response.setStatus(responseStatus); - response.setEntity(subscriptionResult.getResult(), MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); + exchange.getOut().setBody(subscriptionResult.getResult()); + } } diff --git a/src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java index baf8300..37c6c4d 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/config/SubscriptionConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.config; diff --git a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java index 7d98a81..89489f3 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Message.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.payload.entity; diff --git a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java index ac925e0..eae1df1 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayload.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.payload.entity; diff --git a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java index cfd9201..e3bb4c7 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Params.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.payload.entity; diff --git a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java index 685b209..71db011 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/payload/entity/Payload.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.payload.entity; diff --git a/src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java index e76ee59..78f1d3f 100644 --- a/src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/subscription/services/SubscriptionService.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.subscription.services; diff --git a/src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java index 52de8e4..a2b750b 100644 --- a/src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java index a397d91..3255e39 100644 --- a/src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleaner.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java similarity index 64% rename from src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java index fde2fef..a2ff6cf 100644 --- a/src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/ElasticSearchSchemaFactory.java @@ -1,31 +1,34 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; import java.io.IOException; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.dal.exception.ElasticSearchOperationException; import org.onap.aai.sparky.sync.config.ElasticSearchSchemaConfig; -import org.onap.aai.sparky.util.ConfigHelper; -import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -36,45 +39,26 @@ public class ElasticSearchSchemaFactory { private static final String SETTINGS = "settings"; private static final String MAPPINGS = "mappings"; - - private static ObjectMapper mapper = new ObjectMapper(); - - protected static String getConfigAsString(String configItem, String configFileName) - throws ElasticSearchOperationException { - String indexConfig = null; - - try { - indexConfig = ConfigHelper.getFileContents(configFileName); - } catch (IOException exc) { - throw new ElasticSearchOperationException( - "Failed to read index " + configItem + " from file = " + configFileName + ".", exc); - } - - if (indexConfig == null) { - throw new ElasticSearchOperationException( - "Failed to load index " + configItem + " with filename = " + configFileName + "."); - } - return indexConfig; - } - - - public static String getIndexSchema(ElasticSearchSchemaConfig schemaConfig) + private static ObjectMapper mapper = new ObjectMapper(); + private SparkyResourceLoader resourceLoader; + + public String getIndexSchema(ElasticSearchSchemaConfig schemaConfig) throws ElasticSearchOperationException { JsonNode esSettingsNode = null; JsonNode esMappingsNodes = null; try { - + if (schemaConfig.getIndexSettingsFileName() != null) { - esSettingsNode = mapper.readTree(getConfigAsString(SETTINGS, - SparkyConstants.getConfigPath(schemaConfig.getIndexSettingsFileName()))); + esSettingsNode = mapper + .readTree(resourceLoader.getResourceAsString(schemaConfig.getIndexSettingsFileName(),true)); } if (schemaConfig.getIndexMappingsFileName() != null) { - esMappingsNodes = mapper.readTree(getConfigAsString(MAPPINGS, - SparkyConstants.getConfigPath(schemaConfig.getIndexMappingsFileName()))); + esMappingsNodes = mapper + .readTree(resourceLoader.getResourceAsString(schemaConfig.getIndexMappingsFileName(),true)); } } catch (IOException e1) { @@ -102,5 +86,12 @@ public class ElasticSearchSchemaFactory { } + public SparkyResourceLoader getResourceLoader() { + return resourceLoader; + } + + public void setResourceLoader(SparkyResourceLoader resourceLoader) { + this.resourceLoader = resourceLoader; + } } diff --git a/src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java similarity index 80% rename from src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java index 8948b44..bc47fa8 100644 --- a/src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexCleaner.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java index c83aa72..2c1bb16 100644 --- a/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexIntegrityValidator.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java index 6f19054..05c7a5e 100644 --- a/src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/IndexValidator.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexValidator.java similarity index 78% rename from src/main/java/org/onap/aai/sparky/sync/IndexValidator.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexValidator.java index d620337..05e7d91 100644 --- a/src/main/java/org/onap/aai/sparky/sync/IndexValidator.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/IndexValidator.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/SyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncController.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/sync/SyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncController.java index 2f6d99b..bdd009b 100644 --- a/src/main/java/org/onap/aai/sparky/sync/SyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java index 5f8b959..0e0b193 100644 --- a/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerImpl.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; @@ -39,6 +43,8 @@ import org.onap.aai.sparky.sync.config.SyncControllerConfig; import org.onap.aai.sparky.sync.enumeration.OperationState; import org.onap.aai.sparky.sync.enumeration.SynchronizerState; import org.onap.aai.sparky.util.NodeUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * The Class SyncController. diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java new file mode 100644 index 0000000..f20eceb --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java @@ -0,0 +1,29 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.sync; + +public interface SyncControllerRegistrar { + public void registerController(); +} diff --git a/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java similarity index 79% rename from src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java index 152aa68..d4013d3 100644 --- a/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistry.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java index bf78e6a..07653b7 100644 --- a/src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SyncControllerService.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java index 24279c6..9201f07 100644 --- a/src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/SynchronizerConstants.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java index dda3e8e..48625c0 100644 --- a/src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TaskProcessingStats.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java index 07d5e84..e639eff 100644 --- a/src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/TransactionRateMonitor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync; diff --git a/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java index 4ba3405..0197b9b 100644 --- a/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.config; diff --git a/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java index 8288ab0..4f134c3 100644 --- a/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.config; diff --git a/src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java index d83d726..0d089a4 100644 --- a/src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.config; diff --git a/src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java similarity index 96% rename from src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java index f71c660..566c249 100644 --- a/src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/config/SyncControllerConfig.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.config; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java index 17d6433..30d4e71 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java index a734b70..06f60b3 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/AggregationSuggestionEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java new file mode 100644 index 0000000..6ee3351 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java @@ -0,0 +1,41 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.sync.entity; + +/** + * The Interface IndexDocument. + */ +public interface IndexDocument { + + /** + * Derive fields. + */ + public void deriveFields(); + + public String getId(); + + public String getAsJson() throws Exception; + +} diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java similarity index 89% rename from src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java index 0bad15a..0c94227 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableCrossEntityReference.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java index 6961552..9a7f865 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/IndexableEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java similarity index 80% rename from src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java index 9831b89..82c874a 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/MergableEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java index 7c91cd2..8462bc9 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/ObjectIdCollection.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java index 718038c..84fc093 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SearchableEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java index f38545d..2b3f858 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SelfLinkDescriptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java index e7bf1cc..3648b53 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/SuggestionSearchEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java index dc5ffd4..52ea891 100644 --- a/src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/entity/TransactionStorageType.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.entity; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java new file mode 100644 index 0000000..b8c12c9 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java @@ -0,0 +1,32 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.sync.enumeration; + +/** + * The Enum OperationState. + */ +public enum OperationState { + INIT, OK, ERROR, ABORT, PENDING, IGNORED_SYNC_NOT_IDLE +} diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java new file mode 100644 index 0000000..01b28e0 --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java @@ -0,0 +1,32 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.sync.enumeration; + +/** + * The Enum SynchronizerState. + */ +public enum SynchronizerState { + IDLE, PERFORMING_SYNCHRONIZATION, ABORTED +} diff --git a/src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java index 3a60cca..a986dfc 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformActiveInventoryRetrieval.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java index d516ba8..cbc9ccb 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchPut.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java index 5191c65..048d19e 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchRetrieval.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java index 9e8a8fc..2e329e5 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformElasticSearchUpdate.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java similarity index 89% rename from src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java index 141e035..972b049 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/PerformGizmoRetrieval.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java index 983a2ad..f92ccd3 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/StoreDocumentTask.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java index 18567d5..92f3683 100644 --- a/src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/sync/task/SyncControllerTask.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.sync.task; diff --git a/src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java index 0c77148..93b6eb4 100644 --- a/src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.topology.sync; @@ -44,13 +48,14 @@ public class GeoSyncController extends SyncControllerImpl implements SyncControl ActiveInventoryAdapter aaiAdapter, ElasticSearchAdapter esAdapter, ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, NetworkStatisticsConfig aaiStatConfig, NetworkStatisticsConfig esStatConfig, - GeoEntityLookup geoEntityLookup, OxmEntityLookup oxmEntityLookup) throws Exception { + GeoEntityLookup geoEntityLookup, OxmEntityLookup oxmEntityLookup, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); // final String controllerName = "Inventory Geo Synchronizer"; IndexIntegrityValidator indexValidator = new IndexIntegrityValidator(esAdapter, schemaConfig, - endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(indexValidator); diff --git a/src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java index a91ebc4..fcc8a7a 100644 --- a/src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/topology/sync/GeoSynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.topology.sync; diff --git a/src/main/java/org/onap/aai/sparky/util/ConfigHelper.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ConfigHelper.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/util/ConfigHelper.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ConfigHelper.java index 9f43405..cb6cc53 100644 --- a/src/main/java/org/onap/aai/sparky/util/ConfigHelper.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ConfigHelper.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java index de471a2..623ce38 100644 --- a/src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/EncryptConvertor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/Encryptor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/Encryptor.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/util/Encryptor.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/Encryptor.java index 7db8d0d..948df51 100644 --- a/src/main/java/org/onap/aai/sparky/util/Encryptor.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/Encryptor.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; @@ -28,7 +32,7 @@ import org.apache.commons.cli.ParseException; import org.eclipse.jetty.util.security.Password; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.AaiUiMsgs; /** * The Class Encryptor. diff --git a/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/util/ErrorUtil.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java index 0bf00a3..d2bea64 100644 --- a/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/ErrorUtil.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java index e42aa8d..af2e8ca 100644 --- a/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/JsonXmlConverter.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/NodeUtils.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/util/NodeUtils.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java index dbb9877..68645e2 100644 --- a/src/main/java/org/onap/aai/sparky/util/NodeUtils.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/NodeUtils.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/RawByteHelper.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RawByteHelper.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/util/RawByteHelper.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RawByteHelper.java index 7f1062b..99166ca 100644 --- a/src/main/java/org/onap/aai/sparky/util/RawByteHelper.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RawByteHelper.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/RestletUtils.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RestletUtils.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/util/RestletUtils.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RestletUtils.java index cd2d8fd..26dbf62 100644 --- a/src/main/java/org/onap/aai/sparky/util/RestletUtils.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/RestletUtils.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java index d824abf..05f6996 100644 --- a/src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/SuggestionsPermutation.java @@ -1,96 +1,100 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.util; - -import java.util.ArrayList; -import java.util.List; - -public class SuggestionsPermutation { - - /* - * Will return all the unique combinations of the suggestions provided. The order of the - * permutation is not taken into account when computing the uniqueness. eg: A list of A,B,C,D will - * return [[A], [A, B, C, D], [A, C, D], [A, D], [B], [B, C, D], [B, D], [C], [C, D], [D]] - * - * @param list The list to create the unique permutations - * - * @return A Arraylist which contains a array list of all possible combinations - */ - public static ArrayList> getUniqueListForSuggestions( - List originalList) { - ArrayList> lists = new ArrayList>(); - if (originalList.isEmpty()) { - lists.add(new ArrayList()); - return lists; - } - List list = new ArrayList(originalList); - String head = list.get(0); - ArrayList rest = new ArrayList(list.subList(1, list.size())); - - for (ArrayList activeList : getUniqueListForSuggestions(rest)) { - ArrayList newList = new ArrayList(); - newList.add(head); - newList.addAll(activeList); - lists.add(newList); - lists.add(activeList); - } - return lists; - } - - public static ArrayList> getNonEmptyUniqueLists(List list){ - ArrayList> lists = getUniqueListForSuggestions(list); - // remove empty list from the power set - for (ArrayList emptyList : lists ){ - if ( emptyList.isEmpty() ) { - lists.remove(emptyList); - break; - } - } - return lists; - } - - public static List> getListPermutations(List list) { - List inputList = new ArrayList(); - inputList.addAll(list); - if (inputList.size() == 0) { - List> result = new ArrayList>(); - result.add(new ArrayList()); - return result; - } - - List> listOfLists = new ArrayList>(); - - String firstElement = inputList.remove(0); - - List> recursiveReturn = getListPermutations(inputList); - for (List li : recursiveReturn) { - - for (int index = 0; index <= li.size(); index++) { - List temp = new ArrayList(li); - temp.add(index, firstElement); - listOfLists.add(temp); - } - - } - return listOfLists; - } - -} +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.util; + +import java.util.ArrayList; +import java.util.List; + +public class SuggestionsPermutation { + + /* + * Will return all the unique combinations of the suggestions provided. The order of the + * permutation is not taken into account when computing the uniqueness. eg: A list of A,B,C,D will + * return [[A], [A, B, C, D], [A, C, D], [A, D], [B], [B, C, D], [B, D], [C], [C, D], [D]] + * + * @param list The list to create the unique permutations + * + * @return A Arraylist which contains a array list of all possible combinations + */ + public static ArrayList> getUniqueListForSuggestions( + List originalList) { + ArrayList> lists = new ArrayList>(); + if (originalList.isEmpty()) { + lists.add(new ArrayList()); + return lists; + } + List list = new ArrayList(originalList); + String head = list.get(0); + ArrayList rest = new ArrayList(list.subList(1, list.size())); + + for (ArrayList activeList : getUniqueListForSuggestions(rest)) { + ArrayList newList = new ArrayList(); + newList.add(head); + newList.addAll(activeList); + lists.add(newList); + lists.add(activeList); + } + return lists; + } + + public static ArrayList> getNonEmptyUniqueLists(List list){ + ArrayList> lists = getUniqueListForSuggestions(list); + // remove empty list from the power set + for (ArrayList emptyList : lists ){ + if ( emptyList.isEmpty() ) { + lists.remove(emptyList); + break; + } + } + return lists; + } + + public static List> getListPermutations(List list) { + List inputList = new ArrayList(); + inputList.addAll(list); + if (inputList.size() == 0) { + List> result = new ArrayList>(); + result.add(new ArrayList()); + return result; + } + + List> listOfLists = new ArrayList>(); + + String firstElement = inputList.remove(0); + + List> recursiveReturn = getListPermutations(inputList); + for (List li : recursiveReturn) { + + for (int index = 0; index <= li.size(); index++) { + List temp = new ArrayList(li); + temp.add(index, firstElement); + listOfLists.add(temp); + } + + } + return listOfLists; + } + +} diff --git a/src/main/java/org/onap/aai/sparky/util/TreeWalker.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/TreeWalker.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/util/TreeWalker.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/TreeWalker.java index 46934a7..d8bb7b9 100644 --- a/src/main/java/org/onap/aai/sparky/util/TreeWalker.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/util/TreeWalker.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.util; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java index e523ae3..c6d4666 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/EntityTypeAggregation.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java new file mode 100644 index 0000000..0133c9d --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java @@ -0,0 +1,99 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.viewandinspect; + + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.camel.Exchange; +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.aai.restclient.client.OperationResult; +import org.onap.aai.sparky.logging.AaiUiMsgs; +import org.onap.aai.sparky.logging.util.ServletUtils; +import org.onap.aai.sparky.viewandinspect.entity.QueryRequest; +import org.onap.aai.sparky.viewandinspect.services.VisualizationService; +import org.restlet.data.Status; + +public class SchemaVisualizationProcessor { + + + private static final Logger LOG = + LoggerFactory.getInstance().getLogger(SchemaVisualizationProcessor.class); + + private VisualizationService visualizationService; + + public SchemaVisualizationProcessor()throws Exception{} + + protected String generateJsonErrorResponse(String message) { + return String.format("{ \"errorMessage\" : %s }", message); + } + + public void setVisualizationService(VisualizationService visualizationService){ + this.visualizationService = visualizationService; + } + public VisualizationService getVisualizationService(){ + return visualizationService; + } + + public void processVisualizationRequest(Exchange exchange) { + + HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class); + ServletUtils.setUpMdcContext(exchange, request); + + QueryRequest hashId = null; + OperationResult operationResult = null; + + String visualizationPayload = exchange.getIn().getBody(String.class); + hashId = this.getVisualizationService().analyzeQueryRequestBody(visualizationPayload); + + if (hashId != null) { + + operationResult = this.getVisualizationService().buildVisualizationUsingGenericQuery(hashId); + + if (operationResult.getResultCode() != Status.SUCCESS_OK.getCode()) { + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, operationResult.getResultCode()); + LOG.error(AaiUiMsgs.FAILURE_TO_PROCESS_REQUEST, String + .format("Failed to process Visualization Schema Payload = '%s'", visualizationPayload)); + return; + } + + } else { + operationResult = new OperationResult(); + operationResult.setResult(String + .format("Failed to analyze Visualization Schema Payload = '%s'", visualizationPayload)); + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, operationResult.getResultCode()); + LOG.error(AaiUiMsgs.FAILED_TO_ANALYZE, String + .format("Failed to analyze Visualization Schema Payload = '%s'", visualizationPayload)); + return; + + } + + exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, operationResult.getResultCode()); + exchange.getOut().setBody(operationResult.getResult()); + + } +} diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java index 29e1d71..5624b20 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/SparkyConstants.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.config; @@ -30,16 +34,13 @@ public class SparkyConstants { /** Default to unix file separator if system property file.separator is null */ public static final String FILESEP = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - + public static String CONFIG_HOME = System.getProperty("CONFIG_HOME") + FILESEP; - public static String AJSC_HOME = System.getProperty("AJSC_HOME") + FILESEP; - public static String CONFIG_ROOT_LOCATION = AJSC_HOME + "bundleconfig" + FILESEP + "etc" + FILESEP; - public static String STATIC_CONFIG_APP_LOCATION = CONFIG_ROOT_LOCATION + "appprops" + FILESEP; public static String DYNAMIC_CONFIG_APP_LOCATION = CONFIG_HOME; public static String CONFIG_OXM_LOCATION = CONFIG_HOME + "model" + FILESEP; public static String CONFIG_FILTERS_BASE_LOCATION = CONFIG_HOME + FILESEP; - public static String CONFIG_AUTH_LOCATION = CONFIG_HOME + "auth" + FILESEP; + //public static String CONFIG_AUTH_LOCATION = CONFIG_HOME + "auth" + FILESEP; public static String HOST = "host"; public static String IP_ADDRESS = "ipAddress"; @@ -79,10 +80,10 @@ public class SparkyConstants { "/etc/autoSuggestMappings.json"; public static final String ENTITY_DYNAMIC_MAPPINGS_FILE_DEFAULT = "/etc/dynamicMappings.json"; - public static final String FILTER_LIST_FILE_DEFAULT = + /*public static final String FILTER_LIST_FILE_DEFAULT = CONFIG_FILTERS_BASE_LOCATION + "filters" + FILESEP + "aaiui_filters.json"; public static final String FILTER_MAPPING_FILE_DEFAULT = - CONFIG_FILTERS_BASE_LOCATION + "filters" + FILESEP + "aaiui_views.json"; + CONFIG_FILTERS_BASE_LOCATION + "filters" + FILESEP + "aaiui_views.json";*/ public static final String SUBSCRIPTION_OI_MAPPING = CONFIG_FILTERS_BASE_LOCATION + "subscription_object_inspector_mapping.json"; @@ -95,7 +96,7 @@ public class SparkyConstants { public static final String URI_VERSION_REGEX_PATTERN = "aai/v[\\d]+/"; public static final String getConfigPath(String configFile){ - return AJSC_HOME + FILESEP + configFile; + return CONFIG_HOME + FILESEP + configFile; } } diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java index ba64db0..e0cc9c6 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/TierSupportUiConstants.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.config; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java index 96f7dc7..169dbc6 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigs.java @@ -1,27 +1,33 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.config; import java.util.ArrayList; +import org.onap.aai.sparky.config.SparkyResourceLoader; + /** * The Class VisualizationConfig. */ @@ -46,6 +52,8 @@ public class VisualizationConfigs { private ArrayList shallowEntities; private boolean gizmoEnabled; + + private SparkyResourceLoader resourceLoader; /** * Instantiates a new visualization config. @@ -139,7 +147,15 @@ public class VisualizationConfigs { this.gizmoEnabled = gizmoEnabled; } - @Override + public SparkyResourceLoader getResourceLoader() { + return resourceLoader; + } + + public void setResourceLoader(SparkyResourceLoader resourceLoader) { + this.resourceLoader = resourceLoader; + } + + @Override public String toString() { return "VisualizationConfigs [maxSelfLinkTraversalDepth=" + maxSelfLinkTraversalDepth + ", visualizationDebugEnabled=" + visualizationDebugEnabled + ", " diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java index a13ffdb..3981626 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNode.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java similarity index 86% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java index 9599726..5da9c20 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutput.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java similarity index 85% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java index 3e1359f..91c615e 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntry.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java similarity index 87% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java index 06780e8..39106d2 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java index cb30b0d..31ea78a 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipEntity.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java index eb79c2a..5e22164 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GizmoRelationshipHint.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java similarity index 92% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java index b827e74..7e53665 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphMeta.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java index d378c2e..23e50a9 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequest.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java index 5ddc20f..f6f85bb 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessage.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java similarity index 94% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java index 67dd669..09e5956 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNode.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java index 05672f3..5891d51 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLink.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java index 8b73513..0cc0746 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebug.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java similarity index 93% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java index 7f3c093..bc21941 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeMeta.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java index 022c494..8b1cb8d 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransaction.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java index 6d89895..f1a8e4e 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryParams.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java similarity index 77% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java index 6bddb9f..a542efd 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequest.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java index 30de524..5d0f8c3 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToProperty.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java similarity index 88% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java index 0af8a5e..813dec6 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/Relationship.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java similarity index 83% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java index 2aaaf86..c8dfefe 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipData.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java index cb72783..13d0537 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDirectionality.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java index 9a5a03b..9c81a3d 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipList.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java index bef5ee6..d853673 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityList.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java similarity index 84% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java index 41f3ec2..d69994b 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransaction.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java index 2a25379..9b6e4e9 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLink.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java similarity index 95% rename from src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java index f617f31..5171eaf 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNode.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.entity; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java similarity index 78% rename from src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java index 15a3a3c..5c6cdd8 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingAction.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.enumeration; diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java new file mode 100644 index 0000000..18673ef --- /dev/null +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java @@ -0,0 +1,31 @@ +/** + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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 and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. + */ +package org.onap.aai.sparky.viewandinspect.enumeration; + +/** + * The Enum NodeProcessingState. + */ +public enum NodeProcessingState { + INIT, SELF_LINK_UNRESOLVED, SELF_LINK_RESPONSE_UNPROCESSED, NEIGHBORS_UNPROCESSED, READY, ERROR} diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java index 610aec6..c0a7711 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/search/ViewInspectSearchProvider.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.search; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java index 066873d..d0cabfe 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseGizmoVisualizationContext.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java similarity index 99% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java index 21f7fdd..b2bdb43 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java similarity index 97% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java index dffcbdf..b0b8b9e 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationService.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java similarity index 82% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java index 1641aa3..6d4ed88 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationContext.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java similarity index 81% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java index 7693885..c8f252c 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationService.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java similarity index 89% rename from src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java index d763efe..46a70c3 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/VisualizationTransformer.java @@ -1,25 +1,30 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.services; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -29,6 +34,7 @@ import java.util.UUID; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.logging.AaiUiMsgs; import org.onap.aai.sparky.subscription.config.SubscriptionConfig; import org.onap.aai.sparky.util.ConfigHelper; @@ -36,9 +42,9 @@ import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs; import org.onap.aai.sparky.viewandinspect.entity.ActiveInventoryNode; import org.onap.aai.sparky.viewandinspect.entity.D3VisualizationOutput; import org.onap.aai.sparky.viewandinspect.entity.GraphMeta; -import org.onap.aai.sparky.viewandinspect.entity.SparkyGraphNode; -import org.onap.aai.sparky.viewandinspect.entity.SparkyGraphLink; import org.onap.aai.sparky.viewandinspect.entity.NodeDebug; +import org.onap.aai.sparky.viewandinspect.entity.SparkyGraphLink; +import org.onap.aai.sparky.viewandinspect.entity.SparkyGraphNode; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -155,10 +161,17 @@ public class VisualizationTransformer { ObjectMapper mapper = new ObjectMapper(); - final String fileContent = ConfigHelper.getFileContents( - System.getProperty("AJSC_HOME") + this.visualizationConfigs.getAaiEntityNodeDescriptors()); - com.fasterxml.jackson.databind.JsonNode aaiEntityNodeDefinitions = mapper.readTree(fileContent); - graphMeta.setAaiEntityNodeDescriptors(aaiEntityNodeDefinitions); + SparkyResourceLoader resourceLoader = visualizationConfigs.getResourceLoader(); + File aaiEntityDescriptorsFile = resourceLoader.getResourceAsFile(visualizationConfigs.getAaiEntityNodeDescriptors(), true); + + if (aaiEntityDescriptorsFile != null) { + com.fasterxml.jackson.databind.JsonNode aaiEntityNodeDefinitions = + mapper.readTree(aaiEntityDescriptorsFile); + graphMeta.setAaiEntityNodeDescriptors(aaiEntityNodeDefinitions); + } else { + LOG.error(AaiUiMsgs.ERROR_GENERIC, "Failed to find " + visualizationConfigs.getAaiEntityNodeDescriptors()); + graphMeta.setAaiEntityNodeDescriptors(null); + } graphMeta.setNumLinks(linkArrayOutput.size()); graphMeta.setNumNodes(flatNodeArray.size()); diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java index dd0feae..820b749 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformGizmoNodeSelfLinkProcessingTask.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.task; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java similarity index 91% rename from src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java index 797aa69..c686443 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformNodeSelfLinkProcessingTask.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.task; diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java similarity index 90% rename from src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java index e16be76..6d39849 100644 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/task/PerformSelfLinkDeterminationTask.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewandinspect.task; diff --git a/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java similarity index 98% rename from src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java index e0ea5da..8f29519 100644 --- a/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectEntitySynchronizer.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewinspect.sync; @@ -180,6 +184,7 @@ public class ViewInspectEntitySynchronizer extends AbstractEntitySynchronizer OperationResult typeLinksResult = null; try { typeLinksResult = aaiAdapter.getSelfLinksByEntityType(key); + System.out.println(typeLinksResult); aaiWorkOnHand.decrementAndGet(); processEntityTypeSelfLinks(typeLinksResult); } catch (Exception exc) { diff --git a/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java similarity index 89% rename from src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java rename to sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java index 81bf712..bd15e1f 100644 --- a/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewinspect/sync/ViewInspectSyncController.java @@ -1,22 +1,26 @@ /** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ + * ============LICENSE_START=================================================== + * SPARKY (AAI UI service) + * ============================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * 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========================================================= + * ============LICENSE_END===================================================== + * + * ECOMP and OpenECOMP are trademarks + * and service marks of AT&T Intellectual Property. */ package org.onap.aai.sparky.viewinspect.sync; @@ -52,7 +56,8 @@ public class ViewInspectSyncController extends SyncControllerImpl ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, NetworkStatisticsConfig aaiStatConfig, NetworkStatisticsConfig esStatConfig, CrossEntityReferenceLookup crossEntityReferenceLookup, OxmEntityLookup oxmEntityLookup, - SearchableEntityLookup searchableEntityLookup) throws Exception { + SearchableEntityLookup searchableEntityLookup, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); @@ -63,7 +68,7 @@ public class ViewInspectSyncController extends SyncControllerImpl this.schemaConfig = schemaConfig; this.endpointConfig = endpointConfig; IndexIntegrityValidator indexValidator = new IndexIntegrityValidator(esAdapter, schemaConfig, - endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(indexValidator); diff --git a/src/main/resources/logging/AAIUIMsgs.properties b/sparkybe-onap-service/src/main/resources/logging/AAIUIMsgs.properties similarity index 100% rename from src/main/resources/logging/AAIUIMsgs.properties rename to sparkybe-onap-service/src/main/resources/logging/AAIUIMsgs.properties diff --git a/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java diff --git a/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java diff --git a/src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java similarity index 96% rename from src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java index e375979..21899a9 100644 --- a/src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/HistoricalCounterTest.java @@ -1,70 +1,70 @@ -package org.onap.aai.sparky.analytics; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Before; -import org.junit.Test; -import org.onap.aai.sparky.analytics.HistoricalCounter; - -public class HistoricalCounterTest { - - - private HistoricalCounter historicalCounter; - private HistoricalCounter historicalCount; - @Before - public void init() throws Exception { - historicalCounter = new HistoricalCounter(true); - historicalCount = new HistoricalCounter(false); - } - - @Test - public void successfullInitialization() { - assertEquals(-1, historicalCounter.getMin(),0); - assertEquals(0, historicalCounter.getMax(),0); - assertEquals(0, historicalCounter.getNumSamples(),0); - assertEquals(0, historicalCounter.getNumSamples(),0); - assertEquals(0.0, historicalCounter.getValue(),0); - assertEquals(0, historicalCounter.getAvg(),0); - assertTrue(historicalCounter.isSingleValue()); - - } - - @Test - public void updateValuesAndReset() { - historicalCounter.update(-1); - assertEquals(0, historicalCounter.getValue(),0); - historicalCounter.update(10); - assertEquals(10, historicalCounter.getValue(),0); - historicalCounter.reset(); - assertEquals(-1, historicalCounter.getMin(),0); - assertEquals(0, historicalCounter.getMax(),0); - assertEquals(0, historicalCounter.getNumSamples(),0); - assertEquals(0, historicalCounter.getNumSamples(),0); - assertEquals(0.0, historicalCounter.getValue(),0); - - } - - @Test - public void updateValues() { - historicalCount.update(2); - assertEquals(2, historicalCount.getMin(),0); - historicalCount.setMin(10); - historicalCount.update(3); - assertEquals(3, historicalCount.getMin(),0); - historicalCount.setMax(1); - historicalCount.update(4); - assertEquals(4, historicalCount.getMax(),0); - historicalCount.setTotalOfSamples(10); - historicalCount.setNumSamples(2); - assertEquals(5, historicalCount.getAvg(),0); - historicalCount.setTotalOfSamples(10); - assertEquals(10, historicalCount.getTotalOfSamples(),0); - historicalCount.setMaintainSingleValue(true); - assertTrue(historicalCounter.isSingleValue()); - - } - - - -} +package org.onap.aai.sparky.analytics; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; +import org.onap.aai.sparky.analytics.HistoricalCounter; + +public class HistoricalCounterTest { + + + private HistoricalCounter historicalCounter; + private HistoricalCounter historicalCount; + @Before + public void init() throws Exception { + historicalCounter = new HistoricalCounter(true); + historicalCount = new HistoricalCounter(false); + } + + @Test + public void successfullInitialization() { + assertEquals(-1, historicalCounter.getMin(),0); + assertEquals(0, historicalCounter.getMax(),0); + assertEquals(0, historicalCounter.getNumSamples(),0); + assertEquals(0, historicalCounter.getNumSamples(),0); + assertEquals(0.0, historicalCounter.getValue(),0); + assertEquals(0, historicalCounter.getAvg(),0); + assertTrue(historicalCounter.isSingleValue()); + + } + + @Test + public void updateValuesAndReset() { + historicalCounter.update(-1); + assertEquals(0, historicalCounter.getValue(),0); + historicalCounter.update(10); + assertEquals(10, historicalCounter.getValue(),0); + historicalCounter.reset(); + assertEquals(-1, historicalCounter.getMin(),0); + assertEquals(0, historicalCounter.getMax(),0); + assertEquals(0, historicalCounter.getNumSamples(),0); + assertEquals(0, historicalCounter.getNumSamples(),0); + assertEquals(0.0, historicalCounter.getValue(),0); + + } + + @Test + public void updateValues() { + historicalCount.update(2); + assertEquals(2, historicalCount.getMin(),0); + historicalCount.setMin(10); + historicalCount.update(3); + assertEquals(3, historicalCount.getMin(),0); + historicalCount.setMax(1); + historicalCount.update(4); + assertEquals(4, historicalCount.getMax(),0); + historicalCount.setTotalOfSamples(10); + historicalCount.setNumSamples(2); + assertEquals(5, historicalCount.getAvg(),0); + historicalCount.setTotalOfSamples(10); + assertEquals(10, historicalCount.getTotalOfSamples(),0); + historicalCount.setMaintainSingleValue(true); + assertTrue(historicalCounter.isSingleValue()); + + } + + + +} diff --git a/src/test/java/org/onap/aai/sparky/analytics/TransactionRateControllerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/TransactionRateControllerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/analytics/TransactionRateControllerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/analytics/TransactionRateControllerTest.java diff --git a/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java similarity index 99% rename from src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java index 038fe4b..dd6f1c7 100644 --- a/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/autosuggestion/sync/AutosuggestionSynchronizerTest.java @@ -155,7 +155,7 @@ public class AutosuggestionSynchronizerTest { genericVnfSuggestionDescriptor.setEntityName("generic-vnf"); genericVnfSuggestionDescriptor.setPrimaryKeyAttributeNames(pkeyNames); - filtersConfig = new FiltersConfig(null, null); + filtersConfig = new FiltersConfig(null, null, null); FiltersDetailsConfig filtersDetailsConfig = mapper.readValue( TestResourceLoader.getTestResourceDataJson("/filters/aaiui_filters_testConfig.json"), diff --git a/src/test/java/org/onap/aai/sparky/common/search/CommonSearchSuggestionTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/common/search/CommonSearchSuggestionTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/common/search/CommonSearchSuggestionTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/common/search/CommonSearchSuggestionTest.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptorTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceDescriptorTest.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/CrossEntityReferenceTest.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptorTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/GeoEntityDescriptorTest.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptorTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/GeoOxmEntityDescriptorTest.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityContainerLookup.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityContainerLookup.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityContainerLookup.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityContainerLookup.java diff --git a/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptorTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/config/oxm/OxmEntityDescriptorTest.java diff --git a/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/crossentityreference/sync/CrossEntityReferenceSynchronizerTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ActiveInventoryAdapterTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/ElasticSearchAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ElasticSearchAdapterTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/ElasticSearchAdapterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/ElasticSearchAdapterTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/NetworkTransactionTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/NetworkTransactionTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/NetworkTransactionTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/NetworkTransactionTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntityFields.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntityFields.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntityFields.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestDocumentEntityFields.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitsEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitsEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitsEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticHitsEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticSearchResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticSearchResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticSearchResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/AutoSuggestElasticSearchResponse.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/BucketEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/BucketEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/BucketEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/BucketEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHit.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHit.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHit.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHit.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHitsEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHitsEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHitsEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticHitsEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggegrationResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggegrationResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggegrationResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggegrationResponse.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggregation.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggregation.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggregation.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchAggregation.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchCountResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchCountResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchCountResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/ElasticSearchCountResponse.java diff --git a/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/PayloadEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/PayloadEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/PayloadEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/elasticsearch/entity/PayloadEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java similarity index 98% rename from src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java index 82713f5..e710338 100644 --- a/src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/proxy/processor/AaiUiProxyProcessorTest.java @@ -25,14 +25,13 @@ package org.onap.aai.sparky.dal.proxy.processor; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.MediaType; import org.apache.camel.Exchange; import org.apache.camel.Message; -import org.codehaus.groovy.grails.web.json.JSONObject; +import org.json.JSONObject; import org.junit.Before; import org.junit.Test; import org.mockito.AdditionalMatchers; diff --git a/src/test/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/rest/config/RestEndpointConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/DocumentEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/DocumentEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/DocumentEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/DocumentEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/EntityCountResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/EntityCountResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/EntityCountResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/EntityCountResponse.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationResponseEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationResponseEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationResponseEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/GroupByAggregationResponseEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/HitEntity.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/HitEntity.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/HitEntity.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/HitEntity.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionEntityBuilder.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchAbstractionResponse.java diff --git a/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchResult.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchResult.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchResult.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/dal/sas/entity/SearchResult.java diff --git a/src/test/java/org/onap/aai/sparky/editattributes/AttributeUpdaterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/AttributeUpdaterTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/editattributes/AttributeUpdaterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/AttributeUpdaterTest.java diff --git a/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/EditAttributesTest.java diff --git a/src/test/java/org/onap/aai/sparky/editattributes/TestUserAuthorizationReader.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/TestUserAuthorizationReader.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/editattributes/TestUserAuthorizationReader.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/TestUserAuthorizationReader.java diff --git a/src/test/java/org/onap/aai/sparky/editattributes/TestUserValidator.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/TestUserValidator.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/editattributes/TestUserValidator.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/TestUserValidator.java diff --git a/src/test/java/org/onap/aai/sparky/editattributes/entity/EditRequestTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/entity/EditRequestTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/editattributes/entity/EditRequestTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/editattributes/entity/EditRequestTest.java diff --git a/src/test/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilderTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilderTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilderTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/EntityHistoryQueryBuilderTest.java diff --git a/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java diff --git a/src/test/java/org/onap/aai/sparky/inventory/entity/TopographicalEntityTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/entity/TopographicalEntityTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/inventory/entity/TopographicalEntityTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/inventory/entity/TopographicalEntityTest.java diff --git a/src/test/java/org/onap/aai/sparky/logging/util/LoggingUtilsTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/logging/util/LoggingUtilsTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/logging/util/LoggingUtilsTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/logging/util/LoggingUtilsTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/EntityCountHistoryProcessorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityCountHistoryProcessorTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/EntityCountHistoryProcessorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityCountHistoryProcessorTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryBucketTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryBucketTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryBucketTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryBucketTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/EntityTypeSummaryTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/SearchEntityPropertiesTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchEntityPropertiesTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/SearchEntityPropertiesTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchEntityPropertiesTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java similarity index 95% rename from src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java index 90acfa4..7963528 100644 --- a/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/SearchServiceAdapterTest.java @@ -40,7 +40,6 @@ public class SearchServiceAdapterTest { assertNotNull(searchServiceAdapter.getTxnHeader()); assertNotNull(searchServiceAdapter.buildSearchServiceQueryUrl("searchentity-localhost")); assertNotNull(searchServiceAdapter.buildSearchServiceUrlForApi("searchentity-localhost","2.0")); - assertNotNull(searchServiceAdapter.buildSuggestServiceQueryUrl("searchentity-localhost")); } diff --git a/src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java similarity index 64% rename from src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java index 8dd3543..b0aa22b 100644 --- a/src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/UnifiedSearchProcessorTest.java @@ -33,14 +33,16 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import javax.servlet.http.HttpServletRequest; + +import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Message; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.JSONArray; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.impl.DefaultExchange; import org.json.JSONObject; import org.junit.Before; import org.junit.Test; -import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.onap.aai.sparky.common.search.CommonSearchSuggestion; import org.onap.aai.sparky.search.api.SearchProvider; @@ -48,13 +50,8 @@ import org.onap.aai.sparky.search.entity.MockSearchResponse; import org.onap.aai.sparky.search.entity.QuerySearchEntity; import org.onap.aai.sparky.search.entity.SearchSuggestion; import org.onap.aai.sparky.search.registry.SearchProviderRegistry; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.ClientInfo; -import org.restlet.data.MediaType; -import org.restlet.data.Status; +import org.onap.aai.sparky.util.HttpServletHelper; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -124,24 +121,20 @@ public class UnifiedSearchProcessorTest { private SearchServiceAdapter mockSearchAdapter; private UnifiedSearchProcessor unifiedSearchProcessor; - private Exchange mockExchange; private Message mockRequestMessage; - private Message mockResponseMessage; - private Request mockRestletRequest; - private Response mockRestletResponse; - private ClientInfo requestClientInfo; private ObjectMapper mapper; + private Exchange exchange; + private CamelContext camelContext; + @Before public void init() { - - requestClientInfo = new ClientInfo(); - mockExchange = Mockito.mock(Exchange.class); + camelContext = new DefaultCamelContext(); + exchange = new DefaultExchange(camelContext); + mockRequestMessage = Mockito.mock(Message.class); - mockResponseMessage = Mockito.mock(Message.class); - mockRestletRequest = Mockito.mock(Request.class); - mockRestletResponse = Mockito.mock(Response.class); + exchange.setIn(mockRequestMessage); unifiedSearchProcessor = new UnifiedSearchProcessor(); unifiedSearchProcessor.setUseOrderedSearchProviderKeys(true); @@ -175,17 +168,13 @@ public class UnifiedSearchProcessorTest { private void initializeSearchMocks(String requestPayload) { - Mockito.when(mockRestletRequest.getClientInfo()).thenReturn(requestClientInfo); - - Mockito.when(mockRequestMessage.getBody(String.class)).thenReturn(requestPayload); - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_REQUEST, Request.class)) - .thenReturn(mockRestletRequest); - - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_RESPONSE, Response.class)) - .thenReturn(mockRestletResponse); + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletHelper.setRequestPayload(request, "application/json", requestPayload); - Mockito.when(mockExchange.getIn()).thenReturn(mockRequestMessage); - Mockito.when(mockExchange.getOut()).thenReturn(mockResponseMessage); + Mockito.when(request.getRequestURI()).thenReturn("fakeUri"); + Mockito.when(request.getLocalPort()).thenReturn(8001); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(HttpServletRequest.class))).thenReturn(request); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(String.class))).thenReturn(requestPayload); } @@ -221,23 +210,14 @@ public class UnifiedSearchProcessorTest { unifiedSearchProcessor.setSearchProviderRegistry(searchProviderRegistry); // method under test - unifiedSearchProcessor.search(mockExchange); - - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); - - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); + unifiedSearchProcessor.search(exchange); + + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - SearchResponse searchResponse = mapper.readValue(entityPayload.getValue(), SearchResponse.class); + MockSearchResponse searchResponse = mapper.readValue(entityPayload, MockSearchResponse.class); assertEquals(0, searchResponse.getTotalFound()); assertEquals(0, searchResponse.getSuggestions().size()); @@ -262,30 +242,20 @@ public class UnifiedSearchProcessorTest { searchProviderRegistry.addSearchProvider(gamma); unifiedSearchProcessor.setSearchProviderRegistry(searchProviderRegistry); - - + // method under test - unifiedSearchProcessor.search(mockExchange); + unifiedSearchProcessor.search(exchange); - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); - /* * With a null view name, an empty filter set should be returned - there should be 0 filters */ - - SearchResponse searchResponse = mapper.readValue(entityPayload.getValue(), SearchResponse.class); + + SearchResponse searchResponse = mapper.readValue(entityPayload, SearchResponse.class); assertEquals(0, searchResponse.getTotalFound()); assertEquals(0, searchResponse.getSuggestions().size()); @@ -300,7 +270,7 @@ public class UnifiedSearchProcessorTest { } } - private int countSuggestions(String suggestionPrefix, MockSearchResponse response) { + private int countSuggestions(String suggestionPrefix, SearchResponse response) { int totalFound = 0; @@ -315,6 +285,22 @@ public class UnifiedSearchProcessorTest { } + private int countSuggestions(String suggestionPrefix, MockSearchResponse response) { + + int totalFound = 0; + + for ( SearchSuggestion suggestion : response.getSuggestions()) { + + if ( suggestion.getText() != null && suggestion.getText().startsWith(suggestionPrefix)) { + totalFound++; + } + } + + return totalFound; + + } + + @Test public void testSearch_search_when_ThreeSearchProviders_5suggestions_each() throws IOException { @@ -339,23 +325,14 @@ public class UnifiedSearchProcessorTest { unifiedSearchProcessor.setSearchProviderRegistry(searchProviderRegistry); // method under test - unifiedSearchProcessor.search(mockExchange); + unifiedSearchProcessor.search(exchange); - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); - - MockSearchResponse searchResponse = mapper.readValue(entityPayload.getValue(), MockSearchResponse.class); + MockSearchResponse searchResponse = mapper.readValue(entityPayload, MockSearchResponse.class); assertEquals(10, searchResponse.getTotalFound()); assertEquals(10, searchResponse.getSuggestions().size()); @@ -390,23 +367,14 @@ public class UnifiedSearchProcessorTest { addSuggestions(99,"gamma",gamma); // method under test - unifiedSearchProcessor.search(mockExchange); + unifiedSearchProcessor.search(exchange); + + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); - - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); - - MockSearchResponse searchResponse = mapper.readValue(entityPayload.getValue(), MockSearchResponse.class); + MockSearchResponse searchResponse = mapper.readValue(entityPayload, MockSearchResponse.class); assertEquals(13, searchResponse.getTotalFound()); assertEquals(13, searchResponse.getSuggestions().size()); @@ -457,23 +425,14 @@ public class UnifiedSearchProcessorTest { addSuggestions(0,"gamma",gamma); // method under test - unifiedSearchProcessor.search(mockExchange); - - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); + unifiedSearchProcessor.search(exchange); + + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); - - MockSearchResponse searchResponse = mapper.readValue(entityPayload.getValue(), MockSearchResponse.class); + MockSearchResponse searchResponse = mapper.readValue(entityPayload, MockSearchResponse.class); assertEquals(5, searchResponse.getTotalFound()); assertEquals(5, searchResponse.getSuggestions().size()); diff --git a/src/test/java/org/onap/aai/sparky/search/config/SuggestionConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/config/SuggestionConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/config/SuggestionConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/config/SuggestionConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/entity/MockSearchResponse.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/entity/MockSearchResponse.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/entity/MockSearchResponse.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/entity/MockSearchResponse.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java similarity index 73% rename from src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java index edc2540..0644a53 100644 --- a/src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/FilterProcessorTest.java @@ -38,15 +38,21 @@ import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonReader; +import javax.json.stream.JsonParsingException; +import javax.servlet.http.HttpServletRequest; +import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.component.restlet.RestletConstants; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.impl.DefaultExchange; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.onap.aai.restclient.enums.RestAuthenticationMode; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.dal.ElasticSearchAdapter; import org.onap.aai.sparky.dal.rest.RestClientConstructionException; import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig; @@ -61,12 +67,15 @@ import org.onap.aai.sparky.search.filters.config.UiViewListItemConfig; import org.onap.aai.sparky.search.filters.entity.DiscoverFiltersRequest; import org.onap.aai.sparky.search.filters.entity.ViewConfiguration; import org.onap.aai.sparky.search.filters.entity.ViewFilter; +import org.onap.aai.sparky.util.HttpServletHelper; import org.onap.aai.sparky.util.NodeUtils; +import org.onap.aai.sparky.util.SparkyTestConstants; import org.onap.aai.sparky.search.filters.config.FiltersForViewsConfig; import org.restlet.Request; import org.restlet.Response; import org.restlet.data.MediaType; import org.restlet.data.Status; +import org.springframework.core.io.DefaultResourceLoader; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -75,14 +84,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class FilterProcessorTest { private FilterProcessor filterProcessor; - private Exchange mockExchange; - private Message mockRequestMessage; - private Message mockResponseMessage; - private Request mockRestletRequest; - private Response mockRestletResponse; private FilteredSearchHelper filteredSearchHelper; private ObjectMapper mapper; private RestEndpointConfig restEndpointConfig; + + private Exchange exchange; + private CamelContext camelContext; + private Message mockRequestMessage; + protected UiViewListItemConfig generateViewConfig(ViewConfiguration viewConfig) { @@ -163,13 +172,15 @@ public class FilterProcessorTest { @Before public void init()throws RestClientConstructionException { - mockExchange = Mockito.mock(Exchange.class); + + camelContext = new DefaultCamelContext(); + exchange = new DefaultExchange(camelContext); + mockRequestMessage = Mockito.mock(Message.class); - mockResponseMessage = Mockito.mock(Message.class); - mockRestletRequest = Mockito.mock(Request.class); - mockRestletResponse = Mockito.mock(Response.class); + + exchange.setIn(mockRequestMessage); -//TODO-> edit the following:FilteredSearchHelper & FilterProcessor to pass in the correct parameters + //TODO-> edit the following:FilteredSearchHelper & FilterProcessor to pass in the correct parameters restEndpointConfig = new RestEndpointConfig(); restEndpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC); filteredSearchHelper = new FilteredSearchHelper(new FiltersConfig(), @@ -186,40 +197,44 @@ public class FilterProcessorTest { assertNull(filterProcessor.getFilteredSearchHelper()); } - private void verifyResponseAndNumFiltersForBadRequest(Status expectedStatus, int numExpectedFilters) + private void verifyResponseAndNumFiltersForBadRequest(Exchange exchange, Status expectedStatus, int numExpectedFilters) throws JsonParseException, JsonMappingException, IOException { - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(expectedStatus, responseCodeCaptor.getValue()); - - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); - - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); + assertEquals(expectedStatus.getCode(), exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); + + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); - JsonReader jsonReader = Json.createReader(new StringReader(entityPayload.getValue())); + JsonReader jsonReader = Json.createReader(new StringReader(entityPayload)); JsonObject responsePayload = jsonReader.readObject(); JsonObject filters = responsePayload.getJsonObject("filters"); assertEquals(0, filters.size()); } - private void initializeMocks(String requestPayload) { + private void initializeMocks(String requestPayload) throws IOException { + + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + if ( requestPayload != null) { + HttpServletHelper.setRequestPayload(request, "application/json", requestPayload); + } - Mockito.when(mockRequestMessage.getBody(String.class)).thenReturn(requestPayload); + Mockito.when(request.getRequestURI()).thenReturn("fakeUri"); + Mockito.when(request.getLocalPort()).thenReturn(8001); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(HttpServletRequest.class))).thenReturn(request); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(String.class))).thenReturn(requestPayload); - Mockito.when(mockExchange.getIn()).thenReturn(mockRequestMessage); - Mockito.when(mockExchange.getOut()).thenReturn(mockResponseMessage); + SparkyResourceLoader resourceLoader = new SparkyResourceLoader(); + resourceLoader.setResourceLoader(new DefaultResourceLoader()); - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_REQUEST, Request.class)) - .thenReturn(mockRestletRequest); - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_RESPONSE, Response.class)) - .thenReturn(mockRestletResponse); + filterProcessor.setFilteredSearchHelper(filteredSearchHelper); + + FiltersConfig filtersConfig = new FiltersConfig(); + filtersConfig.initializeFiltersDetailsConfig(resourceLoader.getResourceAsFile(SparkyTestConstants.FILTERS_JSON_FILE, false)); + filtersConfig.initializeFiltersForViewsConfig(resourceLoader.getResourceAsFile(SparkyTestConstants.VIEWS_JSON_FILE, false)); + + filteredSearchHelper.setFiltersConfig(filtersConfig); + } @@ -233,22 +248,14 @@ public class FilterProcessorTest { initializeMocks(NodeUtils.convertObjectToJson(vnfSearchrequest, false)); // Test call against 'vnfSearch' - filterProcessor.getFiltersWithValues(mockExchange); - - ArgumentCaptor vnfResponseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(vnfResponseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, vnfResponseCodeCaptor.getValue()); + filterProcessor.getFiltersWithValues(exchange); - ArgumentCaptor vnfEntityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor vnfPayloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(vnfEntityPayload.capture(), vnfPayloadMediaType.capture()); - assertNotNull(vnfEntityPayload.getValue()); - - ArgumentCaptor vnfResponseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(vnfResponseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, vnfPayloadMediaType.getValue()); + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - JsonReader vnfJsonReader = Json.createReader(new StringReader(vnfEntityPayload.getValue())); + String entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); + + JsonReader vnfJsonReader = Json.createReader(new StringReader(entityPayload)); JsonObject vnfResponsePayload = vnfJsonReader.readObject(); JsonObject vnfFilters = vnfResponsePayload.getJsonObject("filters"); @@ -275,22 +282,14 @@ public class FilterProcessorTest { initializeMocks(NodeUtils.convertObjectToJson(dataIntegrityRequest, false)); // Test call against 'dataIntegrity' - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - ArgumentCaptor dIResponseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(dIResponseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, dIResponseCodeCaptor.getValue()); - - ArgumentCaptor dIEntityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor dIPayloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(dIEntityPayload.capture(), dIPayloadMediaType.capture()); - assertNotNull(dIEntityPayload.getValue()); - - ArgumentCaptor dIResponseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(dIResponseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, dIPayloadMediaType.getValue()); + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); - JsonReader dIJsonReader = Json.createReader(new StringReader(dIEntityPayload.getValue())); + entityPayload = exchange.getOut().getBody(String.class); + assertNotNull(entityPayload); + + JsonReader dIJsonReader = Json.createReader(new StringReader(entityPayload)); JsonObject dIResponsePayload = dIJsonReader.readObject(); JsonObject dIFilters = dIResponsePayload.getJsonObject("filters"); @@ -321,9 +320,9 @@ public class FilterProcessorTest { initializeMocks(NodeUtils.convertObjectToJson(discoverFiltersRequest, false)); // Method under test - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - verifyResponseAndNumFiltersForBadRequest(Status.SUCCESS_OK, 0); + verifyResponseAndNumFiltersForBadRequest(exchange, Status.CLIENT_ERROR_NOT_FOUND, 0); } @Test @@ -335,9 +334,9 @@ public class FilterProcessorTest { initializeMocks(NodeUtils.convertObjectToJson(discoverFiltersRequest, false)); // Method under test - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - verifyResponseAndNumFiltersForBadRequest(Status.SUCCESS_OK, 0); + verifyResponseAndNumFiltersForBadRequest(exchange, Status.CLIENT_ERROR_NOT_FOUND, 0); } @Test @@ -346,9 +345,9 @@ public class FilterProcessorTest { initializeMocks(null); // Method under test - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - verifyResponseAndNumFiltersForBadRequest(Status.SUCCESS_OK, 0); + verifyResponseAndNumFiltersForBadRequest(exchange, Status.CLIENT_ERROR_NOT_FOUND, 0); } @Test @@ -357,19 +356,19 @@ public class FilterProcessorTest { initializeMocks(""); // Method under test - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - verifyResponseAndNumFiltersForBadRequest(Status.SUCCESS_OK, 0); + verifyResponseAndNumFiltersForBadRequest(exchange, Status.CLIENT_ERROR_NOT_FOUND, 0); } - @Test + @Test(expected=JsonParsingException.class) public void testGetFiltersWithValues_requestPayloadCausesException() throws IOException { initializeMocks("{"); // Method under test - filterProcessor.getFiltersWithValues(mockExchange); + filterProcessor.getFiltersWithValues(exchange); - verifyResponseAndNumFiltersForBadRequest(Status.SUCCESS_OK, 0); + verifyResponseAndNumFiltersForBadRequest(exchange, Status.SERVER_ERROR_INTERNAL, 0); } } diff --git a/src/test/java/org/onap/aai/sparky/search/filters/FilteredSearchHelperTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/FilteredSearchHelperTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/FilteredSearchHelperTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/FilteredSearchHelperTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java similarity index 91% rename from src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java index d0d2154..54ebe99 100644 --- a/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersConfigTest.java @@ -30,8 +30,8 @@ public class FiltersConfigTest { @Test public void updateValues() { - filtersConfig.setFilterMappingsFileName(""); - assertNotNull(filtersConfig.getFilterMappingsFileName()); + filtersConfig.setViewsFileName(""); + assertNotNull(filtersConfig.getViewsFileName()); filtersConfig.setFiltersFileName(""); assertNotNull(filtersConfig.getFiltersFileName()); filtersConfig.setViewsConfig(viewsConfig); diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersDetailsConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/FiltersForViewsConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterDataSourceConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterListItemConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiFilterOptionsValuesConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/config/UiViewListItemConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/entity/DiscoverFiltersRequest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/DiscoverFiltersRequest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/entity/DiscoverFiltersRequest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/DiscoverFiltersRequest.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewConfiguration.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewConfiguration.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/entity/ViewConfiguration.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewConfiguration.java diff --git a/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewFilter.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewFilter.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/search/filters/entity/ViewFilter.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/search/filters/entity/ViewFilter.java diff --git a/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java diff --git a/src/test/java/org/onap/aai/sparky/security/portal/TestPortalRestAPIServiceImpl.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestPortalRestAPIServiceImpl.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/security/portal/TestPortalRestAPIServiceImpl.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestPortalRestAPIServiceImpl.java diff --git a/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java diff --git a/src/test/java/org/onap/aai/sparky/subscription/config/SubscriptionConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/config/SubscriptionConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/subscription/config/SubscriptionConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/config/SubscriptionConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/subscription/payload/entity/MessageTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/MessageTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/subscription/payload/entity/MessageTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/MessageTest.java diff --git a/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayloadTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayloadTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayloadTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ObjectInspectorPayloadTest.java diff --git a/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ParamsTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ParamsTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/subscription/payload/entity/ParamsTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/ParamsTest.java diff --git a/src/test/java/org/onap/aai/sparky/subscription/payload/entity/PayloadTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/PayloadTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/subscription/payload/entity/PayloadTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/subscription/payload/entity/PayloadTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/AbstractEntitySynchronizerTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/AggregationSynchronizerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/AggregationSynchronizerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/AggregationSynchronizerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/AggregationSynchronizerTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleanerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleanerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleanerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/ElasticSearchIndexCleanerTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/SyncControllerImplTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/SyncControllerImplTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/SyncControllerImplTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/SyncControllerImplTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchEndpointConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/ElasticSearchSchemaConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/NetworkStatisticsConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/sync/config/SyncControllerConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/SyncControllerConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/sync/config/SyncControllerConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/sync/config/SyncControllerConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/AsyncRateControlTester.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/AsyncRateControlTester.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/AsyncRateControlTester.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/AsyncRateControlTester.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/GizmoEntitySummarizer.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexableCrossEntityReferenceTest.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerBuilder.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerBuilder.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerBuilder.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerBuilder.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerServiceTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerServiceTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerServiceTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/SyncControllerServiceTest.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/TestSyncController.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/TestSyncController.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/TestSyncController.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/TestSyncController.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntityTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntityTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntityTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntityTest.java diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java similarity index 98% rename from src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java index 88f28b3..0f145f5 100644 --- a/src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntityTest.java @@ -44,7 +44,7 @@ public class SuggestionSearchEntityTest { @BeforeClass public static void init() throws IOException { config = new FiltersConfig(); - config.setFilterMappingsFileName("src/test/resources/filters/aaiui_views.json"); + config.setViewsFileName("src/test/resources/filters/aaiui_views.json"); config.setFiltersFileName("src/test/resources/filters/aaiui_filters.json"); config.setViewsConfig(config.readUiViewsConfig()); config.setFiltersConfig(config.readUiFiltersConfig()); diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/task/PerformActiveInventoryRetrievalTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/task/PerformActiveInventoryRetrievalTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/synchronizer/task/PerformActiveInventoryRetrievalTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/task/PerformActiveInventoryRetrievalTest.java diff --git a/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java diff --git a/src/test/java/org/onap/aai/sparky/util/ExceptionHelper.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/ExceptionHelper.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/ExceptionHelper.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/ExceptionHelper.java diff --git a/src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java similarity index 99% rename from src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java index 132f330..081c93e 100644 --- a/src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/HttpServletHelper.java @@ -61,7 +61,7 @@ public class HttpServletHelper { */ public static void setRequestPayload(HttpServletRequest request, String mimeType, String payloadContent) { - + try { Mockito.when(request.getContentType()).thenReturn(mimeType); @@ -94,6 +94,7 @@ public class HttpServletHelper { }; Mockito.when(request.getInputStream()).thenReturn(servletInputStream); + Mockito.when(request.getReader()).thenReturn(new BufferedReader(new StringReader(payloadContent))); } catch (IOException ioe) { diff --git a/src/test/java/org/onap/aai/sparky/util/LogValidator.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/LogValidator.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java diff --git a/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java similarity index 84% rename from src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java index 48c8290..cebb494 100644 --- a/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/OxmModelAndProcessorHelper.java @@ -1,8 +1,10 @@ package org.onap.aai.sparky.util; +import java.io.IOException; import java.util.HashSet; import java.util.Set; +import org.onap.aai.sparky.config.SparkyResourceLoader; import org.onap.aai.sparky.config.oxm.CrossEntityReferenceLookup; import org.onap.aai.sparky.config.oxm.GeoEntityLookup; import org.onap.aai.sparky.config.oxm.OxmEntityContainerLookup; @@ -12,6 +14,7 @@ import org.onap.aai.sparky.config.oxm.OxmModelProcessor; import org.onap.aai.sparky.config.oxm.SearchableEntityLookup; import org.onap.aai.sparky.config.oxm.SuggestionEntityLookup; import org.onap.aai.sparky.search.filters.config.FiltersConfig; +import org.springframework.core.io.DefaultResourceLoader; public class OxmModelAndProcessorHelper { @@ -30,10 +33,14 @@ public class OxmModelAndProcessorHelper { private static OxmModelAndProcessorHelper instance = null; - private OxmModelAndProcessorHelper() { + private OxmModelAndProcessorHelper() throws IOException { - this.filtersConfig = new FiltersConfig(SparkyTestConstants.FILTERS_JSON_FILE, - SparkyTestConstants.VIEWS_JSON_FILE); + SparkyResourceLoader resourceLoader = new SparkyResourceLoader(); + resourceLoader.setResourceLoader(new DefaultResourceLoader()); + + this.filtersConfig = new FiltersConfig(); + this.filtersConfig.initializeFiltersDetailsConfig(resourceLoader.getResourceAsFile(SparkyTestConstants.FILTERS_JSON_FILE, false)); + this.filtersConfig.initializeFiltersForViewsConfig(resourceLoader.getResourceAsFile(SparkyTestConstants.VIEWS_JSON_FILE, false)); this.crossEntityReferenceLookup = new CrossEntityReferenceLookup(); this.geoEntityLookup = new GeoEntityLookup(); @@ -54,7 +61,7 @@ public class OxmModelAndProcessorHelper { modelLoader.loadLatestOxmModel(); } - public static OxmModelAndProcessorHelper getInstance() { + public static OxmModelAndProcessorHelper getInstance() throws IOException { if (instance == null) { instance = new OxmModelAndProcessorHelper(); } diff --git a/src/test/java/org/onap/aai/sparky/util/SparkyTestConstants.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/SparkyTestConstants.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/SparkyTestConstants.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/SparkyTestConstants.java diff --git a/src/test/java/org/onap/aai/sparky/util/StringCollectionContainsMatcher.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/StringCollectionContainsMatcher.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/StringCollectionContainsMatcher.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/StringCollectionContainsMatcher.java diff --git a/src/test/java/org/onap/aai/sparky/util/SuggestionsPermutationTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/SuggestionsPermutationTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/SuggestionsPermutationTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/SuggestionsPermutationTest.java diff --git a/src/test/java/org/onap/aai/sparky/util/TestResourceLoader.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/TestResourceLoader.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/TestResourceLoader.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/TestResourceLoader.java diff --git a/src/test/java/org/onap/aai/sparky/util/TreeWalkerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/TreeWalkerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/util/TreeWalkerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/TreeWalkerTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationContextTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationContextTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationContextTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationContextTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationServiceTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationServiceTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationServiceTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/BaseVisualizationServiceTest.java diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java new file mode 100644 index 0000000..83e3ee0 --- /dev/null +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java @@ -0,0 +1,78 @@ +package org.onap.aai.sparky.viewandinspect; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.impl.DefaultExchange; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.aai.sparky.util.HttpServletHelper; +import org.onap.aai.sparky.viewandinspect.entity.QueryRequest; +import org.onap.aai.sparky.viewandinspect.services.VisualizationService; +import org.onap.aai.sparky.viewandinspect.util.SchemaVisualizationTestDataBuilder; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class SchemaVisualizationProcessorTest { + + SchemaVisualizationProcessor schemaVisProcessor; + VisualizationService mockVisualizationService; + + private Exchange exchange; + private CamelContext camelContext; + private Message mockRequestMessage; + + @Before + public void init() throws Exception { + schemaVisProcessor = new SchemaVisualizationProcessor(); + + mockVisualizationService = Mockito.mock(VisualizationService.class); + + camelContext = new DefaultCamelContext(); + exchange = new DefaultExchange(camelContext); + + mockRequestMessage = Mockito.mock(Message.class); + + exchange.setIn(mockRequestMessage); + + } + + @Test + public void testProcessVisualizationRequest() throws JsonParseException, JsonMappingException, IOException { + + String queryRequest = SchemaVisualizationTestDataBuilder.getQueryRequest(); + HttpServletRequest request = Mockito.mock(HttpServletRequest.class); + HttpServletHelper.setRequestPayload(request, "application/json", queryRequest); + + Mockito.when(request.getRequestURI()).thenReturn("fakeUri"); + Mockito.when(request.getLocalPort()).thenReturn(8001); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(HttpServletRequest.class))).thenReturn(request); + Mockito.when(mockRequestMessage.getBody(Mockito.eq(String.class))).thenReturn(queryRequest); + + ObjectMapper nonEmptyMapper = new ObjectMapper(); + nonEmptyMapper.setSerializationInclusion(Include.NON_EMPTY); + QueryRequest queryBody = nonEmptyMapper.readValue(queryRequest, QueryRequest.class); + + Mockito.when(mockVisualizationService.analyzeQueryRequestBody(Mockito.anyString())).thenReturn(queryBody); + Mockito.when(mockVisualizationService.buildVisualizationUsingGenericQuery(Mockito.anyObject())).thenReturn(SchemaVisualizationTestDataBuilder.getSchemaVisResult()); + + schemaVisProcessor.setVisualizationService(mockVisualizationService); + schemaVisProcessor.processVisualizationRequest(exchange); + + assertEquals("{}", exchange.getOut().getBody(String.class)); + assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE)); + + } + +} diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/SearchAdapterTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchAdapterTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/SearchAdapterTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchAdapterTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/SearchResponseTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchResponseTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/SearchResponseTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchResponseTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/SearchServletTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchServletTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/SearchServletTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchServletTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/SearchableGroupsTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchableGroupsTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/SearchableGroupsTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/SearchableGroupsTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/VisualizationTransformerTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/VisualizationTransformerTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/VisualizationTransformerTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/VisualizationTransformerTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/config/VisualizationConfigTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNodeTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNodeTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNodeTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/ActiveInventoryNodeTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutputTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutputTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutputTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/D3VisualizationOutputTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphMetaTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphMetaTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphMetaTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphMetaTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequestTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequestTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequestTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/GraphRequestTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessageTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessageTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessageTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/InlineMessageTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLinkTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLinkTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLinkTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/JsonNodeLinkTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebugTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebugTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebugTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeDebugTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeMetaTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeMetaTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeMetaTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeMetaTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransactionTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransactionTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransactionTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/NodeProcessingTransactionTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryParamsTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryParamsTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryParamsTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryParamsTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequestTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequestTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequestTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/QueryRequestTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToPropertyTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToPropertyTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToPropertyTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelatedToPropertyTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDataTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDataTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDataTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipDataTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipListTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipListTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipListTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipListTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/RelationshipTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchResponseTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchResponseTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchResponseTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchResponseTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityListTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityListTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityListTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SearchableEntityListTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransactionTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransactionTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransactionTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SelfLinkDeterminationTransactionTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLinkTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLinkTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLinkTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphLinkTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNodeTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNodeTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNodeTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/entity/SparkyGraphNodeTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContextTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContextTest.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContextTest.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContextTest.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoEntitySynchronizer.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoEntitySynchronizer.java similarity index 100% rename from src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoEntitySynchronizer.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoEntitySynchronizer.java diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java similarity index 96% rename from src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java index 1fdadfc..c2a1150 100644 --- a/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/sync/ViewInspectGizmoSyncController.java @@ -53,7 +53,8 @@ public class ViewInspectGizmoSyncController extends SyncControllerImpl ElasticSearchSchemaConfig schemaConfig, ElasticSearchEndpointConfig endpointConfig, NetworkStatisticsConfig gizmoStatConfig, NetworkStatisticsConfig esStatConfig, OxmEntityLookup oxmEntityLookup, - SearchableEntityLookup searchableEntityLookup, OxmEntityContainerLookup oxmEntityContainerLookup) throws Exception { + SearchableEntityLookup searchableEntityLookup, OxmEntityContainerLookup oxmEntityContainerLookup, + ElasticSearchSchemaFactory elasticSearchSchemaFactory) throws Exception { super(syncControllerConfig); // final String controllerName = "View and Inspect Entity Synchronizer"; @@ -64,7 +65,7 @@ public class ViewInspectGizmoSyncController extends SyncControllerImpl //this.endpointConfig = endpointConfig; IndexIntegrityValidator indexValidator = new IndexIntegrityValidator(esAdapter, schemaConfig, - endpointConfig, ElasticSearchSchemaFactory.getIndexSchema(schemaConfig)); + endpointConfig, elasticSearchSchemaFactory.getIndexSchema(schemaConfig)); registerIndexValidator(indexValidator); diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java similarity index 98% rename from src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java rename to sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java index 2b71611..335e18a 100644 --- a/src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/viewandinspect/util/SchemaVisualizationTestDataBuilder.java @@ -1,5 +1,6 @@ package org.onap.aai.sparky.viewandinspect.util; +import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -8,8 +9,6 @@ import javax.json.JsonObjectBuilder; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.sparky.config.oxm.OxmEntityLookup; -import org.onap.aai.sparky.config.oxm.OxmModelLoader; -import org.onap.aai.sparky.util.NodeUtils; import org.onap.aai.sparky.util.OxmModelAndProcessorHelper; import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs; import org.onap.aai.sparky.viewandinspect.entity.ActiveInventoryNode; @@ -66,7 +65,7 @@ public class SchemaVisualizationTestDataBuilder { return result; } - public static void buildAaiGraph(VisualizationConfigs visualizationConfigs) { + public static void buildAaiGraph(VisualizationConfigs visualizationConfigs) throws IOException { OxmEntityLookup lookerOfTheOxmEntities = OxmModelAndProcessorHelper.getInstance().getOxmEntityLookup(); ActiveInventoryNode rootNode = new ActiveInventoryNode(visualizationConfigs, lookerOfTheOxmEntities); diff --git a/src/test/resources/bundleconfig/etc/appprops/source-of-truth.properties b/sparkybe-onap-service/src/test/resources/bundleconfig/etc/appprops/source-of-truth.properties similarity index 100% rename from src/test/resources/bundleconfig/etc/appprops/source-of-truth.properties rename to sparkybe-onap-service/src/test/resources/bundleconfig/etc/appprops/source-of-truth.properties diff --git a/src/test/resources/es_test_scripts/commands.txt b/sparkybe-onap-service/src/test/resources/es_test_scripts/commands.txt similarity index 100% rename from src/test/resources/es_test_scripts/commands.txt rename to sparkybe-onap-service/src/test/resources/es_test_scripts/commands.txt diff --git a/src/test/resources/es_test_scripts/geoEntities.json b/sparkybe-onap-service/src/test/resources/es_test_scripts/geoEntities.json similarity index 100% rename from src/test/resources/es_test_scripts/geoEntities.json rename to sparkybe-onap-service/src/test/resources/es_test_scripts/geoEntities.json diff --git a/src/test/resources/es_test_scripts/prepareGeoEntityBulkImport.pl b/sparkybe-onap-service/src/test/resources/es_test_scripts/prepareGeoEntityBulkImport.pl similarity index 100% rename from src/test/resources/es_test_scripts/prepareGeoEntityBulkImport.pl rename to sparkybe-onap-service/src/test/resources/es_test_scripts/prepareGeoEntityBulkImport.pl diff --git a/src/test/resources/es_test_scripts/sampleGeoEntities.csv b/sparkybe-onap-service/src/test/resources/es_test_scripts/sampleGeoEntities.csv similarity index 100% rename from src/test/resources/es_test_scripts/sampleGeoEntities.csv rename to sparkybe-onap-service/src/test/resources/es_test_scripts/sampleGeoEntities.csv diff --git a/src/test/resources/es_test_scripts/topoHistoryBulkLoad.json b/sparkybe-onap-service/src/test/resources/es_test_scripts/topoHistoryBulkLoad.json similarity index 100% rename from src/test/resources/es_test_scripts/topoHistoryBulkLoad.json rename to sparkybe-onap-service/src/test/resources/es_test_scripts/topoHistoryBulkLoad.json diff --git a/src/test/resources/es_test_scripts/topoHistoryConfigSettings.json b/sparkybe-onap-service/src/test/resources/es_test_scripts/topoHistoryConfigSettings.json similarity index 100% rename from src/test/resources/es_test_scripts/topoHistoryConfigSettings.json rename to sparkybe-onap-service/src/test/resources/es_test_scripts/topoHistoryConfigSettings.json diff --git a/src/test/resources/es_test_scripts/topographicalConfigSettings.json b/sparkybe-onap-service/src/test/resources/es_test_scripts/topographicalConfigSettings.json similarity index 100% rename from src/test/resources/es_test_scripts/topographicalConfigSettings.json rename to sparkybe-onap-service/src/test/resources/es_test_scripts/topographicalConfigSettings.json diff --git a/src/test/resources/es_test_scripts/topographysearch_schema.json b/sparkybe-onap-service/src/test/resources/es_test_scripts/topographysearch_schema.json similarity index 100% rename from src/test/resources/es_test_scripts/topographysearch_schema.json rename to sparkybe-onap-service/src/test/resources/es_test_scripts/topographysearch_schema.json diff --git a/src/test/resources/filters/AggregationSuggestionEntity_getIndexDocumentJson_expected.json b/sparkybe-onap-service/src/test/resources/filters/AggregationSuggestionEntity_getIndexDocumentJson_expected.json similarity index 100% rename from src/test/resources/filters/AggregationSuggestionEntity_getIndexDocumentJson_expected.json rename to sparkybe-onap-service/src/test/resources/filters/AggregationSuggestionEntity_getIndexDocumentJson_expected.json diff --git a/src/test/resources/filters/aaiui_filters.json b/sparkybe-onap-service/src/test/resources/filters/aaiui_filters.json similarity index 100% rename from src/test/resources/filters/aaiui_filters.json rename to sparkybe-onap-service/src/test/resources/filters/aaiui_filters.json diff --git a/src/test/resources/filters/aaiui_filters_testConfig.json b/sparkybe-onap-service/src/test/resources/filters/aaiui_filters_testConfig.json similarity index 100% rename from src/test/resources/filters/aaiui_filters_testConfig.json rename to sparkybe-onap-service/src/test/resources/filters/aaiui_filters_testConfig.json diff --git a/src/test/resources/filters/aaiui_views.json b/sparkybe-onap-service/src/test/resources/filters/aaiui_views.json similarity index 100% rename from src/test/resources/filters/aaiui_views.json rename to sparkybe-onap-service/src/test/resources/filters/aaiui_views.json diff --git a/src/test/resources/filters/aaiui_views_testConfig.json b/sparkybe-onap-service/src/test/resources/filters/aaiui_views_testConfig.json similarity index 100% rename from src/test/resources/filters/aaiui_views_testConfig.json rename to sparkybe-onap-service/src/test/resources/filters/aaiui_views_testConfig.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_emptyRequestBody_expectedResponse.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestBody_expectedResponse.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_emptyRequestBody_expectedResponse.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestBody_expectedResponse.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_expectedResponse.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_expectedResponse.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_expectedResponse.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_expectedResponse.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_requestBody.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_requestBody.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_requestBody.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_emptyRequestFilterArray_requestBody.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_successPath_expectedResponse.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_expectedResponse.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_successPath_expectedResponse.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_expectedResponse.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_successPath_operationResult.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_operationResult.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_successPath_operationResult.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_operationResult.json diff --git a/src/test/resources/filters/filterAggregationEndpoint_successPath_requestBody.json b/sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_requestBody.json similarity index 100% rename from src/test/resources/filters/filterAggregationEndpoint_successPath_requestBody.json rename to sparkybe-onap-service/src/test/resources/filters/filterAggregationEndpoint_successPath_requestBody.json diff --git a/src/test/resources/portal/portal-authentication.properties b/sparkybe-onap-service/src/test/resources/portal/portal-authentication.properties similarity index 100% rename from src/test/resources/portal/portal-authentication.properties rename to sparkybe-onap-service/src/test/resources/portal/portal-authentication.properties diff --git a/src/test/resources/portal/roles.config b/sparkybe-onap-service/src/test/resources/portal/roles.config similarity index 100% rename from src/test/resources/portal/roles.config rename to sparkybe-onap-service/src/test/resources/portal/roles.config diff --git a/src/test/resources/sync/ElasticSearch/AfterSync_ElasticSearch_ScrollApi_Successful.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/AfterSync_ElasticSearch_ScrollApi_Successful.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/AfterSync_ElasticSearch_ScrollApi_Successful.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/AfterSync_ElasticSearch_ScrollApi_Successful.json diff --git a/src/test/resources/sync/ElasticSearch/BeforeSync_ElasticSearch_ScrollApi_Successful.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/BeforeSync_ElasticSearch_ScrollApi_Successful.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/BeforeSync_ElasticSearch_ScrollApi_Successful.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/BeforeSync_ElasticSearch_ScrollApi_Successful.json diff --git a/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch1.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch1.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch1.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch1.json diff --git a/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch2.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch2.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch2.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch2.json diff --git a/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch3.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch3.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch3.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch3.json diff --git a/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch4.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch4.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch4.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch4.json diff --git a/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch5.json b/sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch5.json similarity index 100% rename from src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch5.json rename to sparkybe-onap-service/src/test/resources/sync/ElasticSearch/docEntityFromElasticSearch5.json diff --git a/src/test/resources/sync/aai/aai-resources/customer/customer-4.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/customer/customer-4.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/customer/customer-4.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/customer/customer-4.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-50.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-50.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-50.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-50.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-51.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-51.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-51.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-51.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-52.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-52.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-52.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-52.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-53.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-53.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-53.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-53.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-54.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-54.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-54.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-54.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-55.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-55.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-55.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-55.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-56.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-56.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-56.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-56.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-57.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-57.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-57.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-57.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-58.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-58.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-58.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-58.json diff --git a/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-59.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-59.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-instance/service-instance-59.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-instance/service-instance-59.json diff --git a/src/test/resources/sync/aai/aai-resources/service-subscription/service-subscription-2.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-subscription/service-subscription-2.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/service-subscription/service-subscription-2.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/service-subscription/service-subscription-2.json diff --git a/src/test/resources/sync/aai/aai-resources/tenant/tenant-1.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/tenant/tenant-1.json similarity index 100% rename from src/test/resources/sync/aai/aai-resources/tenant/tenant-1.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-resources/tenant/tenant-1.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-50.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-50.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-50.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-50.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-51.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-51.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-51.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-51.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-52.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-52.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-52.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-52.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-53.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-53.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-53.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-53.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-54.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-54.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-54.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-54.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-55.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-55.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-55.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-55.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-56.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-56.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-56.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-56.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-57.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-57.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-57.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-57.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-58.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-58.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-58.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-58.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-59.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-59.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-59.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance-59.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-54.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-54.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-54.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-54.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-55.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-55.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-55.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-instance/service-instance-55.json diff --git a/src/test/resources/sync/aai/aai-traversal/generic-query/service-subscription/service-subscription-2.json b/sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-subscription/service-subscription-2.json similarity index 100% rename from src/test/resources/sync/aai/aai-traversal/generic-query/service-subscription/service-subscription-2.json rename to sparkybe-onap-service/src/test/resources/sync/aai/aai-traversal/generic-query/service-subscription/service-subscription-2.json diff --git a/src/test/resources/sync/aai/activeInventory_complex_nodesQuery_response.json b/sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_complex_nodesQuery_response.json similarity index 100% rename from src/test/resources/sync/aai/activeInventory_complex_nodesQuery_response.json rename to sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_complex_nodesQuery_response.json diff --git a/src/test/resources/sync/aai/activeInventory_generic-vnf_nodesQuery_response.json b/sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_generic-vnf_nodesQuery_response.json similarity index 100% rename from src/test/resources/sync/aai/activeInventory_generic-vnf_nodesQuery_response.json rename to sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_generic-vnf_nodesQuery_response.json diff --git a/src/test/resources/sync/aai/activeInventory_service-subscription_nodesQuery_response.json b/sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_service-subscription_nodesQuery_response.json similarity index 100% rename from src/test/resources/sync/aai/activeInventory_service-subscription_nodesQuery_response.json rename to sparkybe-onap-service/src/test/resources/sync/aai/activeInventory_service-subscription_nodesQuery_response.json diff --git a/src/test/resources/sync/aai/complex1_fullDepth_aaiEntityRetrieval.json b/sparkybe-onap-service/src/test/resources/sync/aai/complex1_fullDepth_aaiEntityRetrieval.json similarity index 100% rename from src/test/resources/sync/aai/complex1_fullDepth_aaiEntityRetrieval.json rename to sparkybe-onap-service/src/test/resources/sync/aai/complex1_fullDepth_aaiEntityRetrieval.json diff --git a/src/test/resources/sync/aai/complex2_fullDepth_aaiEntityRetrieval.json b/sparkybe-onap-service/src/test/resources/sync/aai/complex2_fullDepth_aaiEntityRetrieval.json similarity index 100% rename from src/test/resources/sync/aai/complex2_fullDepth_aaiEntityRetrieval.json rename to sparkybe-onap-service/src/test/resources/sync/aai/complex2_fullDepth_aaiEntityRetrieval.json diff --git a/src/test/resources/sync/aai/complex3_fullDepth_aaiEntityRetrieval.json b/sparkybe-onap-service/src/test/resources/sync/aai/complex3_fullDepth_aaiEntityRetrieval.json similarity index 100% rename from src/test/resources/sync/aai/complex3_fullDepth_aaiEntityRetrieval.json rename to sparkybe-onap-service/src/test/resources/sync/aai/complex3_fullDepth_aaiEntityRetrieval.json diff --git a/src/test/resources/sync/aai/complex4_fullDepth_aaiEntityRetrieval.json b/sparkybe-onap-service/src/test/resources/sync/aai/complex4_fullDepth_aaiEntityRetrieval.json similarity index 100% rename from src/test/resources/sync/aai/complex4_fullDepth_aaiEntityRetrieval.json rename to sparkybe-onap-service/src/test/resources/sync/aai/complex4_fullDepth_aaiEntityRetrieval.json diff --git a/src/test/resources/sync/aai/complex5_fullDepth_aaiEntityRetrieval.json b/sparkybe-onap-service/src/test/resources/sync/aai/complex5_fullDepth_aaiEntityRetrieval.json similarity index 100% rename from src/test/resources/sync/aai/complex5_fullDepth_aaiEntityRetrieval.json rename to sparkybe-onap-service/src/test/resources/sync/aai/complex5_fullDepth_aaiEntityRetrieval.json diff --git a/src/test/resources/sync/aai/generic-vnf-generic-vnf-1_full_depth.json b/sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-1_full_depth.json similarity index 100% rename from src/test/resources/sync/aai/generic-vnf-generic-vnf-1_full_depth.json rename to sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-1_full_depth.json diff --git a/src/test/resources/sync/aai/generic-vnf-generic-vnf-2_full_depth.json b/sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-2_full_depth.json similarity index 100% rename from src/test/resources/sync/aai/generic-vnf-generic-vnf-2_full_depth.json rename to sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-2_full_depth.json diff --git a/src/test/resources/sync/aai/generic-vnf-generic-vnf-3_full_depth.json b/sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-3_full_depth.json similarity index 100% rename from src/test/resources/sync/aai/generic-vnf-generic-vnf-3_full_depth.json rename to sparkybe-onap-service/src/test/resources/sync/aai/generic-vnf-generic-vnf-3_full_depth.json diff --git a/src/test/resources/sync/aai/service-subscription-service-subscription-1.json b/sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-1.json similarity index 100% rename from src/test/resources/sync/aai/service-subscription-service-subscription-1.json rename to sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-1.json diff --git a/src/test/resources/sync/aai/service-subscription-service-subscription-2.json b/sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-2.json similarity index 100% rename from src/test/resources/sync/aai/service-subscription-service-subscription-2.json rename to sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-2.json diff --git a/src/test/resources/sync/aai/service-subscription-service-subscription-3.json b/sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-3.json similarity index 100% rename from src/test/resources/sync/aai/service-subscription-service-subscription-3.json rename to sparkybe-onap-service/src/test/resources/sync/aai/service-subscription-service-subscription-3.json diff --git a/src/test/resources/sync/auth/emptyCert.p12 b/sparkybe-onap-service/src/test/resources/sync/auth/emptyCert.p12 similarity index 100% rename from src/test/resources/sync/auth/emptyCert.p12 rename to sparkybe-onap-service/src/test/resources/sync/auth/emptyCert.p12 diff --git a/src/test/resources/sync/etc/autoSuggestMappings.json b/sparkybe-onap-service/src/test/resources/sync/etc/autoSuggestMappings.json similarity index 100% rename from src/test/resources/sync/etc/autoSuggestMappings.json rename to sparkybe-onap-service/src/test/resources/sync/etc/autoSuggestMappings.json diff --git a/src/test/resources/sync/etc/autoSuggestSettings.json b/sparkybe-onap-service/src/test/resources/sync/etc/autoSuggestSettings.json similarity index 100% rename from src/test/resources/sync/etc/autoSuggestSettings.json rename to sparkybe-onap-service/src/test/resources/sync/etc/autoSuggestSettings.json diff --git a/src/test/resources/user-auth-reader/authorized-users-empty.config b/sparkybe-onap-service/src/test/resources/user-auth-reader/authorized-users-empty.config similarity index 100% rename from src/test/resources/user-auth-reader/authorized-users-empty.config rename to sparkybe-onap-service/src/test/resources/user-auth-reader/authorized-users-empty.config diff --git a/src/test/resources/user-auth-reader/authorized-users.config b/sparkybe-onap-service/src/test/resources/user-auth-reader/authorized-users.config similarity index 100% rename from src/test/resources/user-auth-reader/authorized-users.config rename to sparkybe-onap-service/src/test/resources/user-auth-reader/authorized-users.config diff --git a/src/test/resources/user-validator/authorized-users.config b/sparkybe-onap-service/src/test/resources/user-validator/authorized-users.config similarity index 100% rename from src/test/resources/user-validator/authorized-users.config rename to sparkybe-onap-service/src/test/resources/user-validator/authorized-users.config diff --git a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/conf/jaxrsBeans.groovy b/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/conf/jaxrsBeans.groovy deleted file mode 100644 index da9b558..0000000 --- a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/conf/jaxrsBeans.groovy +++ /dev/null @@ -1,11 +0,0 @@ -beans{ - xmlns cxf: "http://camel.apache.org/schema/cxf" - xmlns jaxrs: "http://cxf.apache.org/jaxrs" - xmlns util: "http://www.springframework.org/schema/util" - - echoService(org.openecomp.sparky.JaxrsEchoService) - - util.list(id: 'jaxrsServices') { - ref(bean:'echoService') - } -} \ No newline at end of file diff --git a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/docs/README.txt b/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/docs/README.txt deleted file mode 100644 index 3707179..0000000 --- a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/docs/README.txt +++ /dev/null @@ -1 +0,0 @@ -Place any docs here that you want to access within the ajsc upon deployment of your service. diff --git a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/lib/README.txt b/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/lib/README.txt deleted file mode 100644 index 639e21b..0000000 --- a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/lib/README.txt +++ /dev/null @@ -1 +0,0 @@ -3rd party JAR's needed by your jars (if any) for a ajsc deployment package go here... \ No newline at end of file diff --git a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/props/module.props b/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/props/module.props deleted file mode 100644 index 17ebc08..0000000 --- a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/props/module.props +++ /dev/null @@ -1 +0,0 @@ -EXAMPLE.PROPERTY=EXAMLE_VALUE \ No newline at end of file diff --git a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/routes/README.txt b/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/routes/README.txt deleted file mode 100644 index a3997db..0000000 --- a/src/main/ajsc/inventory-ui-service_v1/inventory-ui-service/v1/routes/README.txt +++ /dev/null @@ -1 +0,0 @@ -Place any camel routes here that you want to access within the ajsc upon deployment of your service. diff --git a/src/main/assemble/ajsc_module_assembly.xml b/src/main/assemble/ajsc_module_assembly.xml deleted file mode 100644 index 359f792..0000000 --- a/src/main/assemble/ajsc_module_assembly.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - ${version} - false - - zip - - - - ${project.basedir}/target/versioned-ajsc/routes/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/routes/ - - *.route - - - - - - ${project.basedir}/target/versioned-ajsc/docs/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/docs/ - - *.* - - - - - - - ${project.basedir}/target/versioned-ajsc/lib/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/lib/ - - *.jar - - - - - ${project.basedir}/target/versioned-ajsc/extJars/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/extJars/ - - *.jar - - - - - - ${project.basedir}/target/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/lib/ - - *.jar - - - - - ${project.basedir}/target/versioned-ajsc/conf/ - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/conf/ - - *.* - - - - - - - diff --git a/src/main/assemble/ajsc_props_assembly.xml b/src/main/assemble/ajsc_props_assembly.xml deleted file mode 100644 index 6ee4093..0000000 --- a/src/main/assemble/ajsc_props_assembly.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - ${version}_properties - false - - zip - - - - ${project.basedir}/target/versioned-ajsc/props - ${module.ajsc.namespace.name}/${module.ajsc.namespace.version}/props/ - - *.props - - - - - - - - diff --git a/src/main/assemble/ajsc_runtime_assembly.xml b/src/main/assemble/ajsc_runtime_assembly.xml deleted file mode 100644 index c86d265..0000000 --- a/src/main/assemble/ajsc_runtime_assembly.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - runtimeEnvironment - false - - zip - - - - ${project.basedir}/target/versioned-runtime/context/ - runtime/context/ - - *.context - - - - ${project.basedir}/target/versioned-runtime/serviceProperties/ - runtime/serviceProperties/ - - *.props - - - ${project.basedir}/target/versioned-runtime/shiroRole - runtime/shiroRole/ - - *.json - - - ${project.basedir}/target/versioned-runtime/shiroUser - runtime/shiroUser/ - - *.json - - - ${project.basedir}/target/versioned-runtime/shiroUserRole - runtime/shiroUserRole - - *.json - - - - \ No newline at end of file diff --git a/src/main/config/aaiEntityNodeDescriptors.json b/src/main/config/aaiEntityNodeDescriptors.json deleted file mode 100644 index e72bab0..0000000 --- a/src/main/config/aaiEntityNodeDescriptors.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "generalNodeClass": { - "class": "aai-entity-node general-node", - "visualElements": [{ - "type": "circle", - "class": "outer", - "svgAttributes": { - "r": "16" - } - }, - { - "type": "circle", - "class": "inner", - "svgAttributes": { - "r": "10" - } - }, - { - "type": "text", - "class": "id-type-label", - "displayKey": "itemType", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "33" - } - } - }, - { - "type": "text", - "class": "id-value-label", - "displayKey": "itemNameValue", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "48" - } - } - }] - }, - "searchedNodeClass": { - "class": "aai-entity-node search-node", - "visualElements": [{ - "type": "circle", - "class": "outer", - "svgAttributes": { - "r": "16" - } - }, - { - "type": "circle", - "class": "inner", - "svgAttributes": { - "r": "10" - } - }, - { - "type": "text", - "class": "id-type-label", - "displayKey": "itemType", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "33" - } - } - }, - { - "type": "text", - "class": "id-value-label", - "displayKey": "itemNameValue", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "48" - } - } - }] - }, - "selectedSearchedNodeClass": { - "class": "aai-entity-node selected-search-node", - "visualElements": [{ - "type": "circle", - "class": "outer", - "svgAttributes": { - "r": "31" - } - }, - { - "type": "circle", - "class": "inner", - "svgAttributes": { - "r": "20" - } - }, - { - "type": "text", - "class": "id-type-label", - "displayKey": "itemType", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "48" - } - } - }, - { - "type": "text", - "class": "id-value-label", - "displayKey": "itemNameValue", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "63" - } - } - }, - { - "type": "button", - "name": "icon_ellipses", - "class": "node-button", - "shapeAttributes": { - "offset": { - "x": "33", - "y": "-35" - } - }, - "svgAttributes": { - "className": "node-button", - "r": "10" - } - }, - { - "type": "button", - "name": "icon_triangle_warning", - "class": "node-button", - "shapeAttributes": { - "offset": { - "x": "46", - "y": "-12" - } - }, - "svgAttributes": { - "className": "node-button", - "r": "10" - } - }] - }, - "selectedNodeClass": { - "class": "aai-entity-node selected-node", - "visualElements": [{ - "type": "circle", - "class": "outer", - "svgAttributes": { - "r": "31" - } - }, - { - "type": "circle", - "class": "inner", - "svgAttributes": { - "r": "20" - } - }, - { - "type": "text", - "class": "id-type-label", - "displayKey": "itemType", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "48" - } - } - }, - { - "type": "text", - "class": "id-value-label", - "displayKey": "itemNameValue", - "shapeAttributes": { - "offset": { - "x": "0", - "y": "63" - } - } - }, - { - "type": "button", - "name": "icon_ellipses", - "class": "node-button", - "shapeAttributes": { - "offset": { - "x": "33", - "y": "-35" - } - }, - "svgAttributes": { - "className": "node-button", - "r": "10" - } - }, - { - "type": "button", - "name": "icon_triangle_warning", - "class": "node-button", - "shapeAttributes": { - "offset": { - "x": "46", - "y": "-12" - } - }, - "svgAttributes": { - "className": "node-button", - "r": "10" - } - }] - } -} \ No newline at end of file diff --git a/src/main/config/ajsc-chef.jks b/src/main/config/ajsc-chef.jks deleted file mode 100644 index aeca770..0000000 Binary files a/src/main/config/ajsc-chef.jks and /dev/null differ diff --git a/src/main/config/ajsc-jetty.xml b/src/main/config/ajsc-jetty.xml deleted file mode 100644 index 1e026cd..0000000 --- a/src/main/config/ajsc-jetty.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - true - - - /etc/runner-web.xml - /etc/ajsc-override-web.xml - true - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - /extApps - 10 - true - - - - - - - - - - - - - - - - - - - - - /auth/inventory-ui-keystore - - - - - - - - - - - false - false - - - - - - - - - - - - - http/1.1 - - - - - - - - - - - - - - - - - - - - - - 30000 - - - - - - - - - false - - - diff --git a/src/main/config/ajsc-override-web.xml b/src/main/config/ajsc-override-web.xml deleted file mode 100644 index e267829..0000000 --- a/src/main/config/ajsc-override-web.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - LoginFilter - /* - - - - PortalRestAPIProxy - /api/v2/* - - - - springSecurityFilterChain - /* - - - - ManagementServlet - /mgmt - - - - RestletServlet - /rest/* - - - - CamelServlet - /services/* - - - - jsp - *.jsp - *.jspf - *.jspx - *.xsp - *.JSP - *.JSPF - *.JSPX - *.XSP - - - default - /* - - \ No newline at end of file diff --git a/src/main/config/ajscJetty.jks b/src/main/config/ajscJetty.jks deleted file mode 100644 index 48cdbff..0000000 Binary files a/src/main/config/ajscJetty.jks and /dev/null differ diff --git a/src/main/config/autoSuggestMappings.json b/src/main/config/autoSuggestMappings.json deleted file mode 100644 index 7857617..0000000 --- a/src/main/config/autoSuggestMappings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "properties" : { - "entity_suggest" : { - "type" : "completion", - "payloads" : true, - "analyzer" : "custom_analyzer", - "preserve_position_increments": false - } - } -} \ No newline at end of file diff --git a/src/main/config/autoSuggestSettings.json b/src/main/config/autoSuggestSettings.json deleted file mode 100644 index 4525be1..0000000 --- a/src/main/config/autoSuggestSettings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "analysis": { - "filter": { - "eng_stop": { - "type": "stop", - "stopwords": "_english_" - } - }, - "analyzer": { - "custom_analyzer": { - "type": "custom", - "tokenizer": "standard", - "filter": [ - "lowercase", - "asciifolding", - "eng_stop" - ] - } - } - } - } \ No newline at end of file diff --git a/src/main/config/cadi.properties b/src/main/config/cadi.properties deleted file mode 100644 index 83a5ce0..0000000 --- a/src/main/config/cadi.properties +++ /dev/null @@ -1,36 +0,0 @@ -#This properties file is used for defining AAF properties related to the CADI framework. This file is used for running AAF framework - -#In order to test functionality of cadi-ajsc-plugin locally cross domain cookie. Cadi "should" find your hostname for you. -#However, we have seen some situations where this fails. A Local testing -#modification can include modifying your hosts file so that you can use "mywebserver.att.com" for your localhost in order -#to test/verify GLO functionality locally. If you are on a Windows machine, you will already have a machine name associated with -#it that will utilize an AT&T domain such as "sbc.com". You may need to add your domain to this as a comma separated list depending -#upon your particular machine domain. This property is commented out as cadi SHOULD find your machine name. With version 1.2.1 of cadi, -#it appears to resolve Mac machine names as well, now. But, this can be somewhat inconsistent depending on your specific working envrironment. -hostname=mywebserver.att.com - -#Setting csp_domain to PROD will allow for testing using your attuid and password through GLO. -csp_domain=PROD -csp_devl_localhost=true - -basic_realm=csp.att.com -#basic_realm=aaf.att.com -basic_warn=TRUE - -cadi_loglevel=WARN -cadi_keyfile=target/swm/package/nix/dist_files/appl/inventory-ui-service/etc/keyfile - -# Configure AAF -#These are dummy values add appropriate values required -aaf_url=url - -#AJSC - MECHID -#These are dummy values add appropriate values required -aaf_id=dummyid@ajsc.att.com -aaf_password=enc:277edqJCjT0RlUI3BtbDQa-3Ha-CQGd -aaf_timeout=5000 -aaf_clean_interval=30000 -aaf_user_expires=5000 -aaf_high_count=1000 - - diff --git a/src/main/config/csp-cookie-filter.properties b/src/main/config/csp-cookie-filter.properties deleted file mode 100644 index e12109a..0000000 --- a/src/main/config/csp-cookie-filter.properties +++ /dev/null @@ -1,18 +0,0 @@ -# AT&T Global login page. This is the redirect URL -# Production login page: -# https://www.e-access.att.com/empsvcs/hrpinmgt/pagLogin/ -# -# Test login page: -# https://webtest.csp.att.com/empsvcs/hrpinmgt/pagLogin/ -global.login.url=https://www.e-access.att.com/empsvcs/hrpinmgt/pagLogin/ - -# valid domains for open redirect -redirect-domain=att.com,sbc.com,bls.com,cingular.net - -# MOTS ID of the application -application.id=24153 - -# Required by esGateKeeper. Valid values are: -# DEVL - used during development -# PROD - used in production -gatekeeper.environment=PROD \ No newline at end of file diff --git a/src/main/config/dynamicMappings.json b/src/main/config/dynamicMappings.json deleted file mode 100644 index 09a00ac..0000000 --- a/src/main/config/dynamicMappings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "dynamic_templates": [ - { - "strings": { - "match_mapping_type": "string", - "match": "*", - "mapping": { - "type": "string", - "index": "not_analyzed" - } - } - } - ] -} \ No newline at end of file diff --git a/src/main/config/entityCountHistoryMappings.json b/src/main/config/entityCountHistoryMappings.json deleted file mode 100644 index 84e3aec..0000000 --- a/src/main/config/entityCountHistoryMappings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "properties": { - "count": { - "type": "long" - }, - "entityType": { - "type": "string", - "index": "not_analyzed" - }, - "timestamp": { - "type": "date", - "format": "MMM d y HH:m:s||dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ||MM/dd/yyyy||yyyyMMdd'T'HHmmssZ" - } - } -} - diff --git a/src/main/config/es_mappings.json b/src/main/config/es_mappings.json deleted file mode 100644 index 216e3d9..0000000 --- a/src/main/config/es_mappings.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "properties": { - "entityType": { - "type": "string", - "analyzer": "ngram_analyzer", - "search_analyzer": "ngram_analyzer" - }, - "entityPrimaryKeyValue": { - "type": "string", - "index": "not_analyzed" - }, - "searchTagIDs": { - "type": "string" - }, - "searchTags": { - "type": "string", - "analyzer": "ngram_analyzer" - }, - "crossEntityReferenceValues": { - "type": "string", - "analyzer": "ngram_analyzer" - }, - "link": { - "type": "string", - "index": "not_analyzed" - }, - "lastmodTimestamp": { - "type": "date", - "format": "MMM d y HH:m:s||dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ||yyyy-MM-dd HH:mm:ss||MM/dd/yyyy||yyyyMMdd'T'HHmmssZ" - } - } -} \ No newline at end of file diff --git a/src/main/config/es_settings.json b/src/main/config/es_settings.json deleted file mode 100644 index 21a357c..0000000 --- a/src/main/config/es_settings.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "analysis": { - "filter": { - "ngram_filter": { - "type": "nGram", - "min_gram": 1, - "max_gram": 50, - "token_chars": [ - "letter", - "digit", - "punctuation", - "symbol" - ] - } - }, - "analyzer": { - "ngram_analyzer": { - "type": "custom", - "tokenizer": "whitespace", - "filter": [ - "lowercase", - "asciifolding", - "ngram_filter" - ] - }, - "whitespace_analyzer": { - "type": "custom", - "tokenizer": "whitespace", - "filter": [ - "lowercase", - "asciifolding" - ] - } - } - } -} \ No newline at end of file diff --git a/src/main/config/es_sv_mappings.json b/src/main/config/es_sv_mappings.json deleted file mode 100644 index c964ca3..0000000 --- a/src/main/config/es_sv_mappings.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "properties": { - "entityType": { - "type": "string", - "analyzer": "ngram_analyzer", - "search_analyzer": "ngram_analyzer" - }, - "entityPrimaryKeyValue": { - "type": "string", - "index": "not_analyzed" - }, - "searchTagIDs": { - "type": "string" - }, - "searchTags": { - "type": "string", - "analyzer": "ngram_analyzer" - }, - "perspectives" : { - "type": "string", - "index": "not_analyzed" - }, - "crossEntityReferenceValues": { - "type": "string", - "analyzer": "ngram_analyzer" - }, - "link": { - "type": "string", - "index": "not_analyzed" - }, - "lastmodTimestamp": { - "type": "date", - "format": "MMM d y HH:m:s||dd-MM-yyyy HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSSZZ||yyyy-MM-dd HH:mm:ss||MM/dd/yyyy||yyyyMMdd'T'HHmmssZ" - } - } -} \ No newline at end of file diff --git a/src/main/config/es_sv_settings.json b/src/main/config/es_sv_settings.json deleted file mode 100644 index 21a357c..0000000 --- a/src/main/config/es_sv_settings.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "analysis": { - "filter": { - "ngram_filter": { - "type": "nGram", - "min_gram": 1, - "max_gram": 50, - "token_chars": [ - "letter", - "digit", - "punctuation", - "symbol" - ] - } - }, - "analyzer": { - "ngram_analyzer": { - "type": "custom", - "tokenizer": "whitespace", - "filter": [ - "lowercase", - "asciifolding", - "ngram_filter" - ] - }, - "whitespace_analyzer": { - "type": "custom", - "tokenizer": "whitespace", - "filter": [ - "lowercase", - "asciifolding" - ] - } - } - } -} \ No newline at end of file diff --git a/src/main/config/jul-redirect.properties b/src/main/config/jul-redirect.properties deleted file mode 100644 index 8b6624d..0000000 --- a/src/main/config/jul-redirect.properties +++ /dev/null @@ -1,13 +0,0 @@ - -# Bridge JUL->slf4j Logging Configuration File -# -# This file bridges the JUL logging infrastructure into -# SLF4J so JUL logs go to logback implementation provided -# in this project. SLF4J also captures log4j and has -# other framework options as well providing a common -# logging infrastructure for capturing all logs from different -# libraries using different frameworks in one place. - -# Global properties -handlers=org.slf4j.bridge.SLF4JBridgeHandler -.level= ALL diff --git a/src/main/config/keyfile b/src/main/config/keyfile deleted file mode 100644 index 882e86a..0000000 --- a/src/main/config/keyfile +++ /dev/null @@ -1,27 +0,0 @@ -ZuIwp0TkyVPDeX1Up-8JtkMWvjsCpoiu1_VKeWrtrvxunvAke8_tiFyHPPyb2nkhepFYj6tXzpfS -rGz5XF_TH9NbsKaP8u0HV5clz2WriYQRvHS85vjY7hXxkpFuLb7zkLAPqTyIDpj7FiW61NzsRUAq -TM8jH16jr7mBNnb56w24mNGOwznMPcIZKcjgZU1ekaPDFpWyhQElU7Y0q_94P_Gkk45r66Hj22sU -OiOaaftmudZlswLw8-8Zaakqf2yW9HjMVfuYCwSodBHCW5rdB3Ctb5W36rnD_AQco3Ky2PgPmqvk -QkJYuUHpbuDqVHqLOajlKSIGMTIqAIBg51fRaaONtD-Q5xzY8E5wO1YWTLKcP5tsNvUpzM8Wu3NS -ynpGpUcvlTqWWsGzTbzOyamyKkdNdx97sSqjM25Zh1-ps48h6cddGYWpab7SUvqRCS11QBUyLTry -2iwTEHMhHRIbo7PO99ALQfuq9gI1zKGfurJdvLBeBaFs5SCF0AiCZ3WcDO8Rv3HpxVZ2_ShbDxb0 -eMoO6SotXu51fj8Y3-WqsfZziQyEsHyqpg5uQ6yUtz01h5YHLEoVuotF1U4agmQR6kEkYk-wNOiZ -v-8gaA9gtbLoAdKhuKFxQgQLNMf6GzVzZNujbmDzLoZAP_mXAv29aBPaf64Ugzv-Oa5GZdBgD-Xd -_pahML-ionw99r0TnkpShYmDqMKhMdjaP3m87WIAZkIB-L-VTyKcEsJ4340VSzCOsv3waiM0S89u -4cMcG5y-PLY8IoipIlLUPTWD3SjcQ9DV1Dt3T5KjdWLsj48D3W4K4e9PB8yxs0gtUjgVUR2_xEir -G5eDO9Ac1eHFWGDFFP0SgG-TbHJUKlvy9mwLzmU0fC3xPjhqmIr-v0HxF7HN-tmb1LHDorno8tSN -u7kUGcKSchIiFfvkd066crUb2mH7PnXTaWmAjyVj9VsBExFUYEdpHMAV4sAP9-RxZGDRt46UhrDK -QZvvNhBVyOEjHPHWI4vl1r1v8HNH1_2jZu5DVJWyHWR56aCo1lhFH9_X6UAHUHbnXViDONZOVXlT -9-WD0tk2zJGuwrhdZDAnPnAmjfwbwbpnr5Hmex1i1JiD7WVyP1kbfoej2TmdiYbxr9oBYaGQ29JI -aHod7MQCLtvL1z5XgnDPLZ4y3_9SbqHKYbNa8UgZkTLF5EacGThYVFDLA9cbafHDtR1kMGE3vv4D -EJ-0pAYTOGmKlVI7DwNyKsY9JTyudrxTqhOxi9jgcJNWiUaNe9yhL8Pyc2YBqUTTYhh_a2d1rvkZ -0Gh1crviVxqBrIkRKaMRXZ4f1vDLz-3NvG_vwPOo8WRFo5nGmSdTw7CjBaigJ_cYCfDhoP11pEnw -cndsZNcHs-v05LlxeIIMDD_f5Bvz-il_DLA4eK2HqgLdxh8ziSDl2azk14MJY4amzz6reEXUuKLV -RsZGf_jbDGKhE2HuDQ5ovoLOi4OqE1oRuqh-dGxitrYouP2SN1l_1tCEMRth86FMV-6AQtZsvdUo -y9MtQ7e35atjA8nHtgADlDTmJBKQiUHUsOZ77p1qp17HAFMovUkc739opfEYnKUn6Itpw5Ipm_Is -ra6chJUfMpOFof5rb5OjqFAN27c_-mPo1lQU3ndYlKGh_n5V8ufX6v2Yri8WzOPf6hjVYotkmoMP -NPAICDCB8W5ddBjsopzLVVEtaXDu9Qj6-zf77hT4iQ7rBd2Ner8iLqN3Kis0dvkNM3_uH8onau1G -Y_YYw7PPSZyd2S_7Dd6G-IG4ayO6e5DD6oUwwekyiQI_3rTXNa_wldGxqW9u818010ekE4Qdlfcj -beIn7fAeaOjReZ87hRgWyMs-EgTVHw8RL3yI_O6VvRTVRONRF1Y4C_-IYa8z-bfrwXx3BBd9TTgb -EnS9wVOyC2OgUN6BhPLGLhxzkJ05nEjizXEc9t5EPYoSRwesajGGrrG_0-qWbuU5hKLPLkyeJLHb -5HXOTVsrUR59Vov2M3_EswkxcImblox3k3VS2yihZMGyfqLzZIUXgd8ufkevKKU6DxwacGTb \ No newline at end of file diff --git a/src/main/config/runner-web.xml b/src/main/config/runner-web.xml deleted file mode 100644 index 2e39e24..0000000 --- a/src/main/config/runner-web.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - contextConfigLocation - /WEB-INF/spring-servlet.xml, - classpath:applicationContext.xml - - - - - spring.profiles.default - nooauth - - - - org.springframework.web.context.ContextLoaderListener - - - - PortalRestAPIProxy - org.openecomp.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy - - - - LoginFilter - org.onap.aai.sparky.security.filter.LoginFilter - - - - ManagementServlet - ajsc.ManagementServlet - - - - WriteableRequestFilter - com.att.ajsc.csi.writeablerequestfilter.WriteableRequestFilter - - - - RestletServlet - ajsc.restlet.RestletSpringServlet - - org.restlet.component - restletComponent - - - - - CamelServlet - ajsc.servlet.AjscCamelServlet - - - - springSecurityFilterChain - org.springframework.web.filter.DelegatingFilterProxy - - - - spring - org.springframework.web.servlet.DispatcherServlet - 1 - - - - - - - - jsp - org.apache.jasper.servlet.JspServlet - - - - - - - default - org.eclipse.jetty.servlet.DefaultServlet - - dirAllowed - true - - - - - - - - diff --git a/src/main/java/org/onap/aai/sparky/HelloWorld.java b/src/main/java/org/onap/aai/sparky/HelloWorld.java deleted file mode 100644 index f71fa1d..0000000 --- a/src/main/java/org/onap/aai/sparky/HelloWorld.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky; - -import org.apache.camel.Exchange; - -/** - * The Class HelloWorld. - */ -public class HelloWorld { - - /** - * Instantiates a new hello world. - */ - public HelloWorld() {} - - /** - * Speak. - * - * @param exc the exc - */ - public final void speak(Exchange exc) { - exc.setOut(exc.getIn()); - exc.getOut().setBody("Hello World!"); - } -} diff --git a/src/main/java/org/onap/aai/sparky/JaxrsEchoService.java b/src/main/java/org/onap/aai/sparky/JaxrsEchoService.java deleted file mode 100644 index 148ed52..0000000 --- a/src/main/java/org/onap/aai/sparky/JaxrsEchoService.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; - -import com.att.ajsc.beans.PropertiesMapBean; -import com.att.ajsc.filemonitor.AJSCPropertiesMap; - - -/** - * The Class JaxrsEchoService. - */ -@Path("/jaxrs-services") -public class JaxrsEchoService { - - /** - * Ping. - * - * @param input the input - * @return the string - */ - @GET - @Path("/echo/{input}") - @Produces("text/plain") - public String ping(@PathParam("input") String input) { - return "Hello"; - } - - /** - * Gets the property. - * - * @param fileName the file name - * @param input the input - * @return the property - */ - @GET - @Path("/property/{fileName}/{input:.*}") - @Produces("text/plain") - public String getProperty(@PathParam("fileName") String fileName, - @PathParam("input") String input) { - String val = null; - try { - val = AJSCPropertiesMap.getProperty(fileName, input); - if (val == null || val.isEmpty() || val.length() < 1) { - val = PropertiesMapBean.getProperty(fileName, input); - } - } catch (Exception ex) { - System.out.println("*** Error retrieving property " + input + ": " + ex); - } - if (val == null) { - return "Property is not available"; - } - return "Property value is, " + val + "."; - } - -} diff --git a/src/main/java/org/onap/aai/sparky/JaxrsUserService.java b/src/main/java/org/onap/aai/sparky/JaxrsUserService.java deleted file mode 100644 index a918a5f..0000000 --- a/src/main/java/org/onap/aai/sparky/JaxrsUserService.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky; - -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; - -/** - * The Class JaxrsUserService. - */ -@Path("/user") -public class JaxrsUserService { - - private static final Map userIdToNameMap; - - static { - userIdToNameMap = new HashMap(); - userIdToNameMap.put("dw113c", "Doug Wait"); - userIdToNameMap.put("so401q", "Stuart O'Day"); - } - - /** - * 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/src/main/java/org/onap/aai/sparky/Test.java b/src/main/java/org/onap/aai/sparky/Test.java deleted file mode 100644 index dfba83c..0000000 --- a/src/main/java/org/onap/aai/sparky/Test.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky; - -public class Test { - -} diff --git a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java b/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java deleted file mode 100644 index 5fd0dc9..0000000 --- a/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProvider.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.aggregatevnf.search; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.restclient.client.OperationResult; -import org.onap.aai.sparky.common.search.CommonSearchSuggestion; -import org.onap.aai.sparky.logging.AaiUiMsgs; -import org.onap.aai.sparky.search.SearchServiceAdapter; -import org.onap.aai.sparky.search.api.SearchProvider; -import org.onap.aai.sparky.search.entity.QuerySearchEntity; -import org.onap.aai.sparky.search.entity.SearchSuggestion; -import org.onap.aai.sparky.search.filters.entity.UiFilterValueEntity; -import org.onap.aai.sparky.util.NodeUtils; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; - -public class AggregateVnfSearchProvider implements SearchProvider { - - private static final Logger LOG = - LoggerFactory.getInstance().getLogger(AggregateVnfSearchProvider.class); - - private ObjectMapper mapper; - private SearchServiceAdapter searchServiceAdapter = null; - private String autoSuggestIndexName; - private String vnfSearchSuggestionRoute; - - private static final String AUTO_SUGGEST_TEMPLATE = "{ " + "\"results-size\": %d," - + "\"suggest-text\": \"%s\"," + "\"suggest-field\": \"%s\"" + "}"; - - private static final String KEY_SEARCH_RESULT = "searchResult"; - private static final String KEY_HITS = "hits"; - private static final String KEY_DOCUMENT = "document"; - private static final String KEY_CONTENT = "content"; - private static final String KEY_TEXT = "text"; - private static final String KEY_FILTER_LIST = "filterList"; - - public AggregateVnfSearchProvider(SearchServiceAdapter searchServiceAdapter, - String autoSuggestIndexName, String vnfSearchSuggestionRoute) { - mapper = new ObjectMapper(); - this.searchServiceAdapter = searchServiceAdapter; - this.autoSuggestIndexName = autoSuggestIndexName; - this.vnfSearchSuggestionRoute = vnfSearchSuggestionRoute; - } - - public void setAutoSuggestIndexName(String autoSuggestIndexName) { - this.autoSuggestIndexName = autoSuggestIndexName; - } - - @Override - public List search(QuerySearchEntity queryRequest) { - - List returnList = new ArrayList(); - try { - - final String fullUrlStr = - searchServiceAdapter.buildSuggestServiceQueryUrl(autoSuggestIndexName); - String postBody = - String.format(AUTO_SUGGEST_TEMPLATE, Integer.parseInt(queryRequest.getMaxResults()), - queryRequest.getQueryStr(), "entity_suggest"); - OperationResult opResult = - searchServiceAdapter.doPost(fullUrlStr, postBody, "application/json"); - if (opResult.getResultCode() == 200) { - returnList = generateSuggestionsForSearchResponse(opResult.getResult()); - } else { - LOG.error(AaiUiMsgs.ERROR_PARSING_JSON_PAYLOAD_VERBOSE, opResult.getResult()); - return returnList; - } - } catch (Exception exc) { - LOG.error(AaiUiMsgs.ERROR_GENERIC, "Search failed due to error = " + exc.getMessage()); - } - - return returnList; - } - - private List generateSuggestionsForSearchResponse(String operationResult) { - - if (operationResult == null || operationResult.length() == 0) { - return null; - } - - ObjectMapper mapper = new ObjectMapper(); - JsonNode rootNode = null; - List suggestionEntityList = new ArrayList(); - - try { - rootNode = mapper.readTree(operationResult); - JsonNode hitsNode = rootNode.get(KEY_SEARCH_RESULT); - // Check if there are hits that are coming back - if (hitsNode.has(KEY_HITS)) { - ArrayNode hitsArray = (ArrayNode) hitsNode.get(KEY_HITS); - - /* - * next we iterate over the values in the hit array elements - */ - Iterator nodeIterator = hitsArray.elements(); - JsonNode entityNode = null; - CommonSearchSuggestion responseSuggestion = null; - JsonNode sourceNode = null; - - while (nodeIterator.hasNext()) { - entityNode = nodeIterator.next(); - String responseText = getValueFromNode(entityNode, KEY_TEXT); - // do the point transformation as we build the response? - responseSuggestion = new CommonSearchSuggestion(); - responseSuggestion.setRoute(vnfSearchSuggestionRoute); - responseSuggestion.setText(responseText); - responseSuggestion.setHashId(NodeUtils.generateUniqueShaDigest(responseText)); - - sourceNode = entityNode.get(KEY_DOCUMENT).get(KEY_CONTENT); - if (sourceNode.has(KEY_FILTER_LIST)) { - ArrayNode filtersArray = (ArrayNode) sourceNode.get(KEY_FILTER_LIST); - for (int i = 0; i < filtersArray.size(); i++) { - String filterValueString = filtersArray.get(i).toString(); - UiFilterValueEntity filterValue = - mapper.readValue(filterValueString, UiFilterValueEntity.class); - responseSuggestion.getFilterValues().add(filterValue); - } - } - suggestionEntityList.add(responseSuggestion); - } - } - } catch (IOException exc) { - LOG.warn(AaiUiMsgs.SEARCH_RESPONSE_BUILDING_EXCEPTION, exc.getLocalizedMessage()); - } - return suggestionEntityList; - - } - - private String getValueFromNode(JsonNode node, String fieldName) { - - if (node == null || fieldName == null) { - return null; - } - - JsonNode valueNode = node.get(fieldName); - - if (valueNode != null) { - return valueNode.asText(); - } - - return null; - - } - -} diff --git a/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java b/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java deleted file mode 100644 index 29eeb6b..0000000 --- a/src/main/java/org/onap/aai/sparky/config/oxm/OxmModelProcessor.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.config.oxm; - -import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; - -public interface OxmModelProcessor { - - public void processOxmModel(DynamicJAXBContext jaxbContext); - -} diff --git a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java b/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java deleted file mode 100644 index b80a7d7..0000000 --- a/src/main/java/org/onap/aai/sparky/dal/elasticsearch/SearchAdapter.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.dal.elasticsearch; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.MediaType; - -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.cl.mdc.MdcContext; -import org.onap.aai.restclient.client.Headers; -import org.onap.aai.restclient.client.OperationResult; -import org.onap.aai.restclient.client.RestClient; -import org.onap.aai.sparky.dal.sas.config.SearchServiceConfig; -import org.onap.aai.sparky.util.Encryptor; -import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; -import org.slf4j.MDC; - - -/** - * The Class SearchAdapter. - */ -public class SearchAdapter { - - private static final Logger LOG = LoggerFactory.getInstance().getLogger(SearchAdapter.class); - - private RestClient client; - - private Map> commonHeaders; - private SearchServiceConfig sasConfig; - - /** - * Instantiates a new search adapter. - * - * @throws Exception - */ - public SearchAdapter() throws Exception { - sasConfig = SearchServiceConfig.getConfig(); - Encryptor encryptor = new Encryptor(); - - client = new RestClient().validateServerHostname(false).validateServerCertChain(false) - .clientCertFile(SparkyConstants.CONFIG_AUTH_LOCATION + sasConfig.getCertName()) - .clientCertPassword(encryptor.decryptValue(sasConfig.getKeystorePassword())) - .trustStore(SparkyConstants.CONFIG_AUTH_LOCATION + sasConfig.getKeystore()); - - commonHeaders = new HashMap>(); - commonHeaders.put("Accept", Arrays.asList("application/json")); - commonHeaders.put(Headers.FROM_APP_ID, Arrays.asList("AAI-UI")); - } - - public SearchServiceConfig getSasConfig() { - return sasConfig; - } - - public void setSasConfig(SearchServiceConfig sasConfig) { - this.sasConfig = sasConfig; - } - - public OperationResult doPost(String url, String jsonPayload, String acceptContentType) { - OperationResult or = client.post(url, jsonPayload, getTxnHeader(), - MediaType.APPLICATION_JSON_TYPE, MediaType.APPLICATION_JSON_TYPE); - return new OperationResult(or.getResultCode(), or.getResult()); - } - - public OperationResult doGet(String url, String acceptContentType) { - OperationResult or = client.get(url, getTxnHeader(), MediaType.APPLICATION_JSON_TYPE); - return new OperationResult(or.getResultCode(), or.getResult()); - } - - public OperationResult doPut(String url, String payload, String acceptContentType) { - OperationResult or = client.put(url, payload, getTxnHeader(), MediaType.APPLICATION_JSON_TYPE, - MediaType.APPLICATION_JSON_TYPE); - return new OperationResult(or.getResultCode(), or.getResult()); - } - - public OperationResult doDelete(String url, String acceptContentType) { - - OperationResult or = client.delete(url, getTxnHeader(), MediaType.APPLICATION_JSON_TYPE); - return new OperationResult(or.getResultCode(), or.getResult()); - } - - public Map> getTxnHeader() { - Map headers = new HashMap>(); - headers.putAll(this.commonHeaders); - headers.put("X-TransactionId", Arrays.asList(MDC.get(MdcContext.MDC_REQUEST_ID))); - headers.put("X-FromAppId", Arrays.asList(MDC.get(MdcContext.MDC_PARTNER_NAME))); - return headers; - } - - -} diff --git a/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java b/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java deleted file mode 100644 index aecf153..0000000 --- a/src/main/java/org/onap/aai/sparky/dal/rest/HttpMethod.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.dal.rest; - - -/** - * The Enum HttpMethod. - */ -public enum HttpMethod { - GET, PUT, POST, DELETE, PATCH, HEAD -} diff --git a/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java b/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java deleted file mode 100644 index d8e2600..0000000 --- a/src/main/java/org/onap/aai/sparky/dal/rest/RestClientConstructionException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.dal.rest; - -public class RestClientConstructionException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public RestClientConstructionException(String message) { - super(message); - } - -} diff --git a/src/main/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfig.java b/src/main/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfig.java deleted file mode 100644 index 299fc96..0000000 --- a/src/main/java/org/onap/aai/sparky/dal/sas/config/SearchServiceConfig.java +++ /dev/null @@ -1,219 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.dal.sas.config; - -import java.util.Properties; - -import org.onap.aai.sparky.util.ConfigHelper; -import org.onap.aai.sparky.viewandinspect.config.SparkyConstants; - -/** - * The Class ElasticSearchConfig. - */ -public class SearchServiceConfig { - - public static final String CONFIG_FILE = - SparkyConstants.DYNAMIC_CONFIG_APP_LOCATION + "search-service.properties"; - - private static SearchServiceConfig instance; - - private String ipAddress; - - private String httpPort; - - private String indexName; - - private String auditIndexName; - - private String topographicalSearchIndex; - - private String entityCountHistoryIndex; - - private String version; - - private String type; - - private String certName; - - private String keystorePassword; - - private String keystore; - - private static final String IP_ADDRESS_DEFAULT = "localhost"; - - private static final String HTTP_PORT_DEFAULT = "9509"; - - private static final String INDEX_NAME_DEFAULT = "entitySearchIndex-localhost"; - - private static final String AUDIT_INDEX_NAME_DEFAULT = "di-violations"; - - private static final String TOPOGRAPHICAL_INDEX_NAME_DEFAULT = - "topographicalsearchindex-localhost"; - - private static final String ENTITY_COUNT_HISTORY_INDEX_NAME_DEFAULT = - "entitycounthistoryindex-localhost"; - - private static final String VERSION_DEFAULT = "v1"; - - public static SearchServiceConfig getConfig() throws Exception { - - if (instance == null) { - instance = new SearchServiceConfig(); - instance.initializeProperties(); - } - - return instance; - } - - public static void setConfig(SearchServiceConfig config) { - SearchServiceConfig.instance = config; - } - - /** - * Instantiates a new search service config. - */ - public SearchServiceConfig() { - // test method - } - - /** - * Initialize properties. - */ - private void initializeProperties() { - Properties props = ConfigHelper.loadConfigFromExplicitPath(CONFIG_FILE); - - Properties sasProps = ConfigHelper.getConfigWithPrefix("search-service", props); - - ipAddress = sasProps.getProperty("ipAddress", IP_ADDRESS_DEFAULT); - httpPort = sasProps.getProperty("httpPort", "" + HTTP_PORT_DEFAULT); - version = sasProps.getProperty("version", "" + VERSION_DEFAULT); - indexName = sasProps.getProperty("indexName", INDEX_NAME_DEFAULT); - auditIndexName = sasProps.getProperty("auditIndexName", AUDIT_INDEX_NAME_DEFAULT); - topographicalSearchIndex = sasProps.getProperty("topographicalIndexName", - TOPOGRAPHICAL_INDEX_NAME_DEFAULT); - entityCountHistoryIndex = sasProps.getProperty("entityCountHistoryIndexName", - ENTITY_COUNT_HISTORY_INDEX_NAME_DEFAULT); - certName = - sasProps.getProperty("ssl.cert-name", "aai-client-cert.p12"); - keystorePassword = sasProps.getProperty("ssl.keystore-password", - "OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o"); - keystore = sasProps.getProperty("ssl.keystore", "tomcat_keystore"); - } - - public String getIpAddress() { - return ipAddress; - } - - public void setIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - } - - public String getHttpPort() { - return httpPort; - } - - public void setHttpPort(String httpPort) { - this.httpPort = httpPort; - } - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getAuditIndexName() { - return auditIndexName; - } - - public void setAuditIndexName(String auditIndexName) { - this.auditIndexName = auditIndexName; - } - - public String getTopographicalSearchIndex() { - return topographicalSearchIndex; - } - - public void setTopographicalSearchIndex(String topographicalSearchIndex) { - this.topographicalSearchIndex = topographicalSearchIndex; - } - - public String getEntityCountHistoryIndex() { - return entityCountHistoryIndex; - } - - public void setEntityCountHistoryIndex(String entityCountHistoryIndex) { - this.entityCountHistoryIndex = entityCountHistoryIndex; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - - public String getCertName() { - return certName; - } - - public void setCertName(String certName) { - this.certName = certName; - } - - public String getKeystorePassword() { - return keystorePassword; - } - - public void setKeystorePassword(String keystorePassword) { - this.keystorePassword = keystorePassword; - } - - public String getKeystore() { - return keystore; - } - - public void setKeystore(String keystore) { - this.keystore = keystore; - } - - @Override - public String toString() { - return "SearchServiceConfig [ipAddress=" + ipAddress + ", httpPort=" + httpPort + ", indexName=" - + indexName + ", auditIndexName=" + auditIndexName + ", topographicalSearchIndex=" - + topographicalSearchIndex + ", entityCountHistoryIndex=" + entityCountHistoryIndex - + ", version=" + version + ", type=" + type + "]"; - } - - -} diff --git a/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java b/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java deleted file mode 100644 index fce4550..0000000 --- a/src/main/java/org/onap/aai/sparky/search/api/SearchProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.search.api; - -import java.util.List; - -import org.onap.aai.sparky.search.entity.QuerySearchEntity; -import org.onap.aai.sparky.search.entity.SearchSuggestion; - -public interface SearchProvider { - - List search(QuerySearchEntity queryRequest); - -} diff --git a/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java b/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java deleted file mode 100644 index 68ad059..0000000 --- a/src/main/java/org/onap/aai/sparky/search/entity/SearchSuggestion.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.search.entity; - -public interface SearchSuggestion { - public String getHashId(); - - public void setHashId(String hashId); - - public String getRoute(); - - public void setRoute(String route); - - public String getText(); - - public void setText(String searchText); -} diff --git a/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java b/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java deleted file mode 100644 index 51177f1..0000000 --- a/src/main/java/org/onap/aai/sparky/security/CookieDecryptor.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.security; - -public interface CookieDecryptor { - - String decryptCookie(String encryptedCookie); - -} diff --git a/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java b/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java deleted file mode 100644 index 1ed0c4f..0000000 --- a/src/main/java/org/onap/aai/sparky/sync/SyncControllerRegistrar.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.sync; - -public interface SyncControllerRegistrar { - public void registerController(); -} diff --git a/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java b/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java deleted file mode 100644 index 39df7fa..0000000 --- a/src/main/java/org/onap/aai/sparky/sync/entity/IndexDocument.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.sync.entity; - -/** - * The Interface IndexDocument. - */ -public interface IndexDocument { - - /** - * Derive fields. - */ - public void deriveFields(); - - public String getId(); - - public String getAsJson() throws Exception; - -} diff --git a/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java b/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java deleted file mode 100644 index 7712af9..0000000 --- a/src/main/java/org/onap/aai/sparky/sync/enumeration/OperationState.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.sync.enumeration; - -/** - * The Enum OperationState. - */ -public enum OperationState { - INIT, OK, ERROR, ABORT, PENDING, IGNORED_SYNC_NOT_IDLE -} diff --git a/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java b/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java deleted file mode 100644 index ca84d9a..0000000 --- a/src/main/java/org/onap/aai/sparky/sync/enumeration/SynchronizerState.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.sync.enumeration; - -/** - * The Enum SynchronizerState. - */ -public enum SynchronizerState { - IDLE, PERFORMING_SYNCHRONIZATION, ABORTED -} diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java b/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java deleted file mode 100644 index 9fba533..0000000 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessor.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.viewandinspect; - - -import org.apache.camel.Exchange; -import org.apache.camel.component.restlet.RestletConstants; -import org.onap.aai.cl.api.Logger; -import org.onap.aai.cl.eelf.LoggerFactory; -import org.onap.aai.cl.mdc.MdcContext; -import org.onap.aai.restclient.client.OperationResult; -import org.onap.aai.sparky.logging.AaiUiMsgs; -import org.onap.aai.sparky.util.NodeUtils; -import org.onap.aai.sparky.viewandinspect.entity.QueryRequest; -import org.onap.aai.sparky.viewandinspect.services.VisualizationService; - -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.ClientInfo; -import org.restlet.data.MediaType; -import org.restlet.data.Status; - -public class SchemaVisualizationProcessor { - - - private static final Logger LOG = - LoggerFactory.getInstance().getLogger(SchemaVisualizationProcessor.class); - - private VisualizationService visualizationService; - - public SchemaVisualizationProcessor()throws Exception{} - - protected String generateJsonErrorResponse(String message) { - return String.format("{ \"errorMessage\" : %s }", message); - } - - public void setVisualizationService(VisualizationService visualizationService){ - this.visualizationService = visualizationService; - } - public VisualizationService getVisualizationService(){ - return visualizationService; - } - - public void processVisualizationRequest(Exchange exchange){ - - String visualizationPayload=""; - QueryRequest hashId = null; - OperationResult operationResult = null; - Request request = null; - Response response = null; - Object xTransactionId = null; - Object partnerName = null; - - xTransactionId = exchange.getIn().getHeader("X-TransactionId"); - if (xTransactionId == null) { - xTransactionId = NodeUtils.getRandomTxnId(); - } - partnerName = exchange.getIn().getHeader("X-FromAppId"); - if (partnerName == null) { - partnerName = "Browser"; - } - - request = exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST, Request.class); - response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - /* Disables automatic Apache Camel Restlet component logging which prints out an undesirable log entry - which includes client (e.g. browser) information */ - request.setLoggable(false); - - ClientInfo clientInfo = request.getClientInfo(); - MdcContext.initialize((String) xTransactionId, "AAI-UI", "", (String) partnerName, clientInfo.getAddress() + ":" + clientInfo.getPort()); - - visualizationPayload = exchange.getIn().getBody(String.class); - hashId = this.getVisualizationService().analyzeQueryRequestBody(visualizationPayload); - - if (hashId != null) { - - operationResult = this.getVisualizationService().buildVisualizationUsingGenericQuery(hashId); - - if(operationResult.getResultCode()== Status.SUCCESS_OK.getCode()){ - - response.setStatus(Status.SUCCESS_OK); - } - else{ - response.setStatus(Status.SERVER_ERROR_INTERNAL); - LOG.error(AaiUiMsgs.FAILURE_TO_PROCESS_REQUEST, - String.format("Failed to process Visualization Schema Payload = '%s'", visualizationPayload)); - } - - }else{ - operationResult = new OperationResult(); - operationResult.setResult(String.format("Failed to analyze Visualization Schema Payload = '%s'", visualizationPayload)); - response.setStatus(Status.SERVER_ERROR_INTERNAL); - LOG.error(AaiUiMsgs.FAILED_TO_ANALYZE, - String.format("Failed to analyze Visualization Schema Payload = '%s'", visualizationPayload)); - - } - - - response.setEntity(operationResult.getResult(), MediaType.APPLICATION_JSON); - exchange.getOut().setBody(response); - } -} diff --git a/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java b/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java deleted file mode 100644 index e16354b..0000000 --- a/src/main/java/org/onap/aai/sparky/viewandinspect/enumeration/NodeProcessingState.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 Amdocs - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.sparky.viewandinspect.enumeration; - -/** - * The Enum NodeProcessingState. - */ -public enum NodeProcessingState { - INIT, SELF_LINK_UNRESOLVED, SELF_LINK_RESPONSE_UNPROCESSED, NEIGHBORS_UNPROCESSED, READY, ERROR} diff --git a/src/main/resources/authentication/tomcat_keystore b/src/main/resources/authentication/tomcat_keystore deleted file mode 100644 index efa01f8..0000000 Binary files a/src/main/resources/authentication/tomcat_keystore and /dev/null differ diff --git a/src/main/resources/extApps/aai.xml b/src/main/resources/extApps/aai.xml deleted file mode 100644 index f7f8073..0000000 --- a/src/main/resources/extApps/aai.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - /extApps/aai.war - - /staticContent/aai - diff --git a/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context b/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context deleted file mode 100644 index 8514196..0000000 --- a/src/main/runtime/context/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.context +++ /dev/null @@ -1 +0,0 @@ -{"context":{"contextClass":"ajsc.Context","contextId":"__module_ajsc_namespace_name__:__module_ajsc_namespace_version__","contextName":"__module_ajsc_namespace_name__","contextVersion":"__module_ajsc_namespace_version__","description":"__module_ajsc_namespace_name__ Context"}} \ No newline at end of file diff --git a/src/main/runtime/context/default#0.context b/src/main/runtime/context/default#0.context deleted file mode 100644 index d1b5ab4..0000000 --- a/src/main/runtime/context/default#0.context +++ /dev/null @@ -1 +0,0 @@ -{"context":{"contextClass":"ajsc.Context","contextId":"default:0","contextName":"default","contextVersion":"0","description":"Default Context"}} \ No newline at end of file diff --git a/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json b/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json deleted file mode 100644 index d0954cf..0000000 --- a/src/main/runtime/deploymentPackage/__module.ajsc.namespace.name__#__module.ajsc.namespace.version__.json +++ /dev/null @@ -1 +0,0 @@ -{"deploymentPackage":{"Class":"ajsc.DeploymentPackage","Id":"__module.ajsc.namespace.name__:__module_ajsc_namespace_version__","namespace":"__module_ajsc_namespace_name__","namespaceVersion":"__module_ajsc_namespace_version__","description":"__module_ajsc_namespace_name__ __module_ajsc_namespace_version__ - default description","userId":"ajsc"}} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/ajscadmin.json b/src/main/runtime/shiroRole/ajscadmin.json deleted file mode 100644 index f5e981e..0000000 --- a/src/main/runtime/shiroRole/ajscadmin.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"ajscadmin","name":"ajscadmin","permissions":"[ajscadmin:*, ajsc:*]"} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json b/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 2dae9f5..0000000 --- a/src/main/runtime/shiroRole/contextadmin#__module.ajsc.namespace.name__.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"contextadmin:__module_ajsc_namespace_name__","name":"contextadmin:__module_ajsc_namespace_name__","permissions":"[]"} \ No newline at end of file diff --git a/src/main/runtime/shiroRole/contextadmin#default.json b/src/main/runtime/shiroRole/contextadmin#default.json deleted file mode 100644 index 5de814e..0000000 --- a/src/main/runtime/shiroRole/contextadmin#default.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroRoleClass":"ajsc.auth.ShiroRole","shiroRoleId":"contextadmin:default","name":"contextadmin:default","permissions":"[]"} \ No newline at end of file diff --git a/src/main/runtime/shiroUser/ajsc.json b/src/main/runtime/shiroUser/ajsc.json deleted file mode 100644 index f4c7855..0000000 --- a/src/main/runtime/shiroUser/ajsc.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserClass":"ajsc.auth.ShiroUser","shiroUserId":"ajsc","passwordHash":"9471697417008c880720ba54c6038791ad7e98f3b88136fe34f4d31a462dd27a","permissions":"[*:*]","username":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json b/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json deleted file mode 100644 index cb8d483..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#ajscadmin.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:ajscadmin","roleId":"ajscadmin","userId":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json b/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json deleted file mode 100644 index 95d2361..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#contextadmin#__module.ajsc.namespace.name__.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:contextadmin:__module_ajsc_namespace_name__","roleId":"contextadmin:__module_ajsc_namespace_name__","userId":"ajsc"} \ No newline at end of file diff --git a/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json b/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json deleted file mode 100644 index 2bd5063..0000000 --- a/src/main/runtime/shiroUserRole/ajsc#contextadmin#default.json +++ /dev/null @@ -1 +0,0 @@ -{"shiroUserRoleClass":"ajsc.auth.ShiroUserRole","shiroUserRoleId":"ajsc:contextadmin:default","roleId":"contextadmin:default","userId":"ajsc"} \ No newline at end of file diff --git a/src/main/scripts/encNameValue.sh b/src/main/scripts/encNameValue.sh deleted file mode 100644 index daefd00..0000000 --- a/src/main/scripts/encNameValue.sh +++ /dev/null @@ -1,20 +0,0 @@ -# The script invokes the com.amdocs.aai.audit.security.encryption.EncryptedPropValue class to generate an encrypted value -# e.g -# ./encNameValue.sh odl.auth.password admin -# will return: -# odl.auth.password.x=f1e2c25183ef4b4ff655e7cd94d0c472 -# -if [ "$#" -ne 2 ]; then - echo "Illegal number of parameters (expected 2)" - echo "Usage: `basename $0` " 1>&2 - exit 1 -fi - -# On Windows we must use a different CLASSPATH separator character -if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then - CPSEP=\; -else - CPSEP=: -fi - -java -cp ".${CPSEP}../extJars/*" com.att.aai.util.EncryptedPropValue -n $1 -v $2 diff --git a/src/main/scripts/start.sh b/src/main/scripts/start.sh deleted file mode 100644 index 87043d9..0000000 --- a/src/main/scripts/start.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh - -BASEDIR="/opt/app/sparky" -AJSC_HOME="$BASEDIR" -AJSC_CONF_HOME="$BASEDIR/bundleconfig/" - -if [ -z "$CONFIG_HOME" ]; then - echo "CONFIG_HOME must be set in order to start up process" - exit 1 -fi - -if [ -z "$KEY_STORE_PASSWORD" ]; then - echo "KEY_STORE_PASSWORD must be set in order to start up process" - exit 1 -else - sed -i /"KEY_STORE_PASSWORD"/d $AJSC_CONF_HOME/etc/sysprops/sys-props.properties - echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties -fi - -if [ -z "$KEY_MANAGER_PASSWORD" ]; then - echo "KEY_MANAGER_PASSWORD must be set in order to start up process" - exit 1 -else - sed -i /"KEY_MANAGER_PASSWORD"/d $AJSC_CONF_HOME/etc/sysprops/sys-props.properties - echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties -fi - -if [ -z "$UI_HTTPS_PORT" ] && [ -z "$UI_HTTP_PORT" ]; then - echo "Either UI_HTTPS_PORT or UI_HTTP_PORT must be set in order to start up process" - exit 1 -fi - -# Add any routes configured at deploy time to the sparky deployment -if [ -n "$DYNAMIC_ROUTES" ]; then - if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then - echo "Adding the following dynamic routes to the deployment: " - mkdir -p /tmp/sparky/v1/routes - for f in `ls $DYNAMIC_ROUTES` - do - cp $DYNAMIC_ROUTES/$f /tmp/sparky/v1/routes - echo "Adding dynamic route $DYNAMIC_ROUTES/$f" - done - jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky - rm -rf /tmp/sparky - fi -fi - -# Add any spring bean configuration files to the sparky deployment -if [ -n "$SERVICE_BEANS" ]; then - if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then - echo "Adding the following dynamic service beans to the deployment: " - mkdir -p /tmp/sparky/v1/conf - for f in `ls $SERVICE_BEANS` - do - cp $SERVICE_BEANS/$f /tmp/sparky/v1/conf - echo "Adding dynamic service bean $SERVICE_BEANS/$f" - done - jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky - rm -rf /tmp/sparky - fi -fi - -# Add any dynamic component configuration files to the sparky deployment -if [ -n "$COMPLIB" ]; then - if [ -e /opt/app/sparky/services/inventory-ui-service_v1.zip ]; then - echo "Adding the following dynamic libraries to the deployment: " - mkdir -p /tmp/sparky/v1/lib - for f in `ls $COMPLIB` - do - cp $COMPLIB/$f /tmp/sparky/v1/lib - echo "Adding dynamic library $COMPLIB/$f" - done - jar uf /opt/app/sparky/services/inventory-ui-service_v1.zip* -C /tmp/ sparky - rm -rf /tmp/sparky - fi -fi - -CLASSPATH="$AJSC_HOME/lib/ajsc-runner-2.0.0.jar" -CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/" -CLASSPATH="$CLASSPATH:$CONFIG_HOME/portal/" -PROPS="-DAJSC_HOME=$AJSC_HOME" -PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/" -PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml" -PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME" -PROPS="$PROPS -DAJSC_EXTERNAL_LIB_FOLDERS=$AJSC_HOME/commonLibs" -PROPS="$PROPS -DAJSC_EXTERNAL_PROPERTIES_FOLDERS=$AJSC_HOME/ajsc-shared-config/etc" -PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=ajsc-tier-support-ui" -PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1" -PROPS="$PROPS -DSOACLOUD_SERVICE_VERSION=0.0.0" -PROPS="$PROPS -Dserver.port=8000" -PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME" - -echo $CLASSPATH - -if [ "$UI_HTTPS_PORT" ]; then - /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ sslport=$UI_HTTPS_PORT -elif [ "$UI_HTTP_PORT" ]; then - /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms1024m -Xmx4096m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=/ port=$UI_HTTP_PORT -fi diff --git a/src/test/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProviderTest.java b/src/test/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProviderTest.java deleted file mode 100644 index 5a24edf..0000000 --- a/src/test/java/org/onap/aai/sparky/aggregatevnf/search/AggregateVnfSearchProviderTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.onap.aai.sparky.aggregatevnf.search; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; - -import javax.ws.rs.core.MediaType; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.onap.aai.restclient.client.OperationResult; -import org.onap.aai.restclient.client.RestClient; -import org.onap.aai.restclient.enums.RestAuthenticationMode; -import org.onap.aai.sparky.dal.rest.config.RestEndpointConfig; -import org.onap.aai.sparky.search.SearchServiceAdapter; -import org.onap.aai.sparky.search.entity.QuerySearchEntity; - -public class AggregateVnfSearchProviderTest { - - private AggregateVnfSearchProvider aggregateVnfSearchProvider; - private RestEndpointConfig restEndpointConfig; - private SearchServiceAdapter searchserviceAdapter; - private QuerySearchEntity querySearchEntity; - private String successResponsePayload; - private OperationResult successResult = null; - private String goodDrTargetUrl = "https://0.0.0.0:9502/ui-request/servicegraph"; - - @Before - public void init() throws Exception { - - restEndpointConfig = new RestEndpointConfig(); - successResponsePayload = "good-payload"; - successResult = new OperationResult(200, successResponsePayload); - restEndpointConfig.setRestAuthenticationMode(RestAuthenticationMode.SSL_BASIC); - searchserviceAdapter = Mockito.mock(SearchServiceAdapter.class); - aggregateVnfSearchProvider = - new AggregateVnfSearchProvider(searchserviceAdapter, "auto-suggest", "schema"); - querySearchEntity = new QuerySearchEntity(); - - } - - @Test - public void updateValues() { - - assertNotNull(aggregateVnfSearchProvider.search(querySearchEntity)); - aggregateVnfSearchProvider.setAutoSuggestIndexName("auto-suggest-index-1"); - - } - - @Test - public void testProxyMessage_Success() { - Mockito.when(searchserviceAdapter.doPost(Mockito.eq(goodDrTargetUrl), Mockito.anyString(), - Mockito.eq(MediaType.APPLICATION_JSON_TYPE.toString()))).thenReturn(successResult); - } - -} diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java b/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java deleted file mode 100644 index d501e3e..0000000 --- a/src/test/java/org/onap/aai/sparky/viewandinspect/SchemaVisualizationProcessorTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.onap.aai.sparky.viewandinspect; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.IOException; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.component.restlet.RestletConstants; -import org.junit.Before; -import org.junit.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import org.onap.aai.restclient.client.OperationResult; -import org.onap.aai.sparky.viewandinspect.entity.QueryRequest; -import org.onap.aai.sparky.viewandinspect.services.VisualizationService; -import org.onap.aai.sparky.viewandinspect.util.SchemaVisualizationTestDataBuilder; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.data.ClientInfo; -import org.restlet.data.MediaType; -import org.restlet.data.Status; - -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class SchemaVisualizationProcessorTest { - - SchemaVisualizationProcessor schemaVisProcessor; - VisualizationService mockVisualizationService; - - private ClientInfo requestClientInfo; - private Exchange mockExchange; - private Message mockRequestMessage; - private Message mockResponseMessage; - private Request mockRestletRequest; - private Response mockRestletResponse; - - - @Before - public void init() throws Exception { - schemaVisProcessor = new SchemaVisualizationProcessor(); - - mockVisualizationService = Mockito.mock(VisualizationService.class); - - requestClientInfo = new ClientInfo(); - mockExchange = Mockito.mock(Exchange.class); - mockRequestMessage = Mockito.mock(Message.class); - mockResponseMessage = Mockito.mock(Message.class); - mockRestletRequest = Mockito.mock(Request.class); - mockRestletResponse = Mockito.mock(Response.class); - } - - @Test - public void testProcessVisualizationRequest() throws JsonParseException, JsonMappingException, IOException { - // Create a mock service with a set response for this test - - generateMocksForTest(SchemaVisualizationTestDataBuilder.getQueryRequest()); - schemaVisProcessor.setVisualizationService(mockVisualizationService); - schemaVisProcessor.processVisualizationRequest(mockExchange); - - ArgumentCaptor responseCodeCaptor = ArgumentCaptor.forClass(Status.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setStatus(responseCodeCaptor.capture()); - assertEquals(Status.SUCCESS_OK, responseCodeCaptor.getValue()); - - ArgumentCaptor entityPayload = ArgumentCaptor.forClass(String.class); - ArgumentCaptor payloadMediaType = ArgumentCaptor.forClass(MediaType.class); - Mockito.verify(mockRestletResponse, Mockito.atLeast(1)).setEntity(entityPayload.capture(), - payloadMediaType.capture()); - assertNotNull(entityPayload.getValue()); - - ArgumentCaptor responseObject = ArgumentCaptor.forClass(Response.class); - Mockito.verify(mockResponseMessage, Mockito.atLeast(1)).setBody(responseObject.capture()); - assertEquals(MediaType.APPLICATION_JSON, payloadMediaType.getValue()); - } - - private void generateMocksForTest(String queryRequest) throws JsonParseException, JsonMappingException, IOException { - - Mockito.when(mockRestletRequest.getClientInfo()).thenReturn(requestClientInfo); - - Mockito.when(mockRequestMessage.getBody(String.class)).thenReturn(queryRequest); - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_REQUEST, Request.class)).thenReturn(mockRestletRequest); - Mockito.when(mockRequestMessage.getHeader(RestletConstants.RESTLET_RESPONSE, Response.class)).thenReturn(mockRestletResponse); - - Mockito.when(mockExchange.getIn()).thenReturn(mockRequestMessage); - Mockito.when(mockExchange.getOut()).thenReturn(mockResponseMessage); - - ObjectMapper nonEmptyMapper = new ObjectMapper(); - nonEmptyMapper.setSerializationInclusion(Include.NON_EMPTY); - QueryRequest queryBody = nonEmptyMapper.readValue(queryRequest, QueryRequest.class); - - Mockito.when(mockVisualizationService.analyzeQueryRequestBody(Mockito.anyString())).thenReturn(queryBody); - Mockito.when(mockVisualizationService.buildVisualizationUsingGenericQuery(Mockito.anyObject())).thenReturn(SchemaVisualizationTestDataBuilder.getSchemaVisResult()); - } -} diff --git a/version.properties b/version.properties deleted file mode 100644 index faf06bb..0000000 --- a/version.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Versioning variables -# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) -# because they are used in Jenkins, whose plug-in doesn't support - -major=1 -minor=2 -patch=0 - -base_version=${major}.${minor}.${patch} - -# Release must be completed with git revision # in Jenkins -release_version=${base_version} -snapshot_version=${base_version}-SNAPSHOT