.classpath
.project
.settings/
+.vscode
aaiOffline/
target/
logs/
*/appconfig-local/
/.metadata/
*.iml
-.idea
\ No newline at end of file
+.idea
+**/schema/**/*.xml
\ No newline at end of file
<groupId>org.onap.aai</groupId>
<artifactId>sparky-be</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>aai-sparky-be</name>
+APP_HOME=.
+CONFIG_HOME=./config
+
#
# disable the default thyme leaf icon on web-pages
#
spring.mvc.favicon.enabled=false
-schema.ingest.file=${CONFIG_HOME}/schemaIngest.properties
\ No newline at end of file
+schema.ingest.file=${CONFIG_HOME}/schemaIngest.properties
+
+# Properties for the SchemaLocationsBean
+# Files named aai_oxm_v*.xml are unpacked here:
+# Schema Version Related Attributes
+schema.uri.base.path=/aai
+# Lists all of the versions in the schema
+schema.version.list=v9,v10,v11,v12,v13,v14
+# Specifies from which version should the depth parameter to default to zero
+schema.version.depth.start=v10
+# Specifies from which version should the related link be displayed in response payload
+schema.version.related.link.start=v10
+# Specifies from which version should the client see only the uri excluding host info
+# Before this version server base will also be included
+schema.version.app.root.start=v11
+# Specifies from which version should the namespace be changed
+schema.version.namespace.change.start=v12
+# Specifies from which version should the client start seeing the edge label in payload
+schema.version.edge.label.start=v12
+# Specifies the version that the application should default to
+schema.version.api.default=v14
+
+# Schema Location Related Attributes
+schema.configuration.location=NA
+
+# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0
+schema.configuration.location=N/A
+schema.nodes.location=${APP_HOME}/onap/oxm
+schema.edges.location=
+
+# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application)
+# schema.version.depth.start=${oxm.apiVersion}
+# schema.version.related.link.start=${oxm.apiVersion}
+# schema.version.app.root.start=${oxm.apiVersion}
+# schema.version.namespace.change.start=${oxm.apiVersion}
+# schema.version.edge.label.start=${oxm.apiVersion}
+
+# Properties required by AAI Schema Service MS
+schema.translator.list=config
+schema.service.base.url=${oxm.schemaServiceBaseUrl}
+schema.service.nodes.endpoint=nodes?version=
+schema.service.edges.endpoint=edgerules?version=
+schema.service.versions.endpoint=versions
+schema.local=true
+schema.filename=mockrequests
+#Default rest client is the two-way-ssl
+#schema.service.client=two-way-ssl
+#Replace the below with the A&AI client key store
+schema.service.ssl.key-store=${oxm.schemaServiceKeystore}
+#Replace the below with the A&AI tomcat trust store
+schema.service.ssl.trust-store=${oxm.schemaServiceTruststore}
+schema.service.ssl.key-store-password=${oxm.schemaServiceKeystorePassword}
+schema.service.ssl.trust-store-password=${oxm.schemaServiceTruststorePassword}
+
+spring.application.name=sparky
+
+nodeDir=src/main/resources/schema/onap/oxm/
+edgeDir=src/main/resources/schema/onap/oxm
+schemaIngestPropLoc=src/main/resources/schema/onap/oxm
\ No newline at end of file
<logger name="ch.qos.logback.classic" level="WARN" />
<logger name="ch.qos.logback.core" level="WARN" />
- <root>
- <appender-ref ref="asyncEELF" />
+ <root level="INFO">
+ <appender-ref ref="STDOUT" />
<!-- <appender-ref ref="asyncEELFDebug" /> -->
</root>
-# Properties for the SchemaLocationsBean
-# Files named aai_oxm_v*.xml are unpacked here:
-# Schema Version Related Attributes
-schema.uri.base.path=/aai
-# Lists all of the versions in the schema
-schema.version.list=v9,v10,v11,v12,v13,v14
-# Specifies from which version should the depth parameter to default to zero
-schema.version.depth.start=v10
-# Specifies from which version should the related link be displayed in response payload
-schema.version.related.link.start=v10
-# Specifies from which version should the client see only the uri excluding host info
-# Before this version server base will also be included
-schema.version.app.root.start=v11
-# Specifies from which version should the namespace be changed
-schema.version.namespace.change.start=v12
-# Specifies from which version should the client start seeing the edge label in payload
-schema.version.edge.label.start=v12
-# Specifies the version that the application should default to
-schema.version.api.default=v14
-
-# Schema Location Related Attributes
-schema.configuration.location=NA
-
-# New propterties required by the aai-common - aai-schema-ingest lib as of 1.3.0
-schema.configuration.location=N/A
-schema.nodes.location=${oxm.schemaNodeDir}
-schema.edges.location=
-# These versions need to exist if they are included in the list
-schema.version.list=${oxm.apiVersionList}
-# Decalares the oxm version to load
-schema.version.api.default=${oxm.apiVersion}
-
-# Setting this values to ${oxm.apiVersion} only to ensure the value used exists (we don't use this properties in our application)
-schema.version.depth.start=${oxm.apiVersion}
-schema.version.related.link.start=${oxm.apiVersion}
-schema.version.app.root.start=${oxm.apiVersion}
-schema.version.namespace.change.start=${oxm.apiVersion}
-schema.version.edge.label.start=${oxm.apiVersion}
-
-# Properties required by AAI Schema Service MS
-schema.translator.list=config
-schema.service.base.url=${oxm.schemaServiceBaseUrl}
-schema.service.nodes.endpoint=nodes?version=
-schema.service.edges.endpoint=edgerules?version=
-schema.service.versions.endpoint=versions
-schema.local=true
-schema.filename=mockrequests
-#Default rest client is the two-way-ssl
-#schema.service.client=two-way-ssl
-#Replace the below with the A&AI client key store
-schema.service.ssl.key-store=${oxm.schemaServiceKeystore}
-#Replace the below with the A&AI tomcat trust store
-schema.service.ssl.trust-store=${oxm.schemaServiceTruststore}
-schema.service.ssl.key-store-password=${oxm.schemaServiceKeystorePassword}
-schema.service.ssl.trust-store-password=${oxm.schemaServiceTruststorePassword}
-
-spring.application.name=sparky
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans profile="test" xmlns="http://www.springframework.org/schema/beans"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+
+ <context:property-placeholder location="file:${schemaIngestPropLoc}" ignore-unresolvable="true" />
+
+ <bean id="filtersConfig" class="org.onap.aai.sparky.search.filters.config.FiltersConfig">
+
+ </bean>
+
+ <bean id="sparkyResourceLoader" class="org.onap.aai.sparky.config.SparkyResourceLoader">
+ <property name="configHomeEnvVar" value="${CONFIG_HOME}" />
+ </bean>
+
+ <bean id="crossEntityReferenceLookup"
+ class="org.onap.aai.sparky.config.oxm.CrossEntityReferenceLookup" />
+
+ <bean id="oxmEntityLookup" class="org.onap.aai.sparky.config.oxm.OxmEntityLookup" />
+
+
+ <bean id="suggestionEntityLookup" class="org.onap.aai.sparky.config.oxm.SuggestionEntityLookup">
+ <constructor-arg ref="filtersConfig" />
+ </bean>
+ <bean id="oxmModelProcessorSet" class="org.springframework.beans.factory.config.SetFactoryBean">
+ <property name="targetSetClass" value="java.util.HashSet" />
+ <property name="sourceSet">
+ <set>
+ <ref bean="oxmEntityLookup" />
+ </set>
+ </property>
+ </bean>
+
+ <bean id="schemaLocationsBean" class="org.onap.aai.setup.SchemaLocationsBean">
+ <!-- When running with AJSC these properties must be injected directly.
+ The reason for this is unknown. -->
+ <property name="nodeDirectory" value="${nodeDir}" />
+ <property name="edgeDirectory" value="${edgeDir}" />
+ </bean>
+
+ <bean id="schemaVersions" class="org.onap.aai.setup.SchemaVersions" />
+
+ <bean id="oxmConfigTranslator" class="org.onap.aai.setup.AAIConfigTranslator">
+ <constructor-arg ref="schemaLocationsBean" />
+ <constructor-arg ref="schemaVersions" />
+ </bean>
+
+ <bean id="nodeIngestor" class="org.onap.aai.nodes.NodeIngestor">
+ <constructor-arg ref="oxmConfigTranslator" />
+ </bean>
+
+
+ <bean id="oxmModelLoader" class="org.onap.aai.sparky.config.oxm.OxmModelLoader"
+ init-method="loadModel">
+ <!-- <constructor-arg name="apiVersionOverride" value="V11" /> -->
+ <constructor-arg ref="oxmModelProcessorSet" />
+ <constructor-arg ref="schemaVersions" />
+ </bean>
+
+</beans>
class="org.onap.aai.sparky.search.registry.SearchProviderRegistry" />
<bean id="sparkyResourceLoader" class="org.onap.aai.sparky.config.SparkyResourceLoader">
- <property name="configHomeEnvVar" value="CONFIG_HOME" />
+ <property name="configHomeEnvVar" value="${CONFIG_HOME}" />
</bean>
<bean id="unifiedSearchProcessor" class="org.onap.aai.sparky.search.UnifiedSearchProcessor">
<parent>
<groupId>org.onap.aai</groupId>
<artifactId>sparky-be</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
</parent>
<groupId>org.onap.aai.sparky-be</groupId>
<artifactId>sparkybe-onap-application</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
</aai.build.directory>
<aai.docker.namespace>onap</aai.docker.namespace>
<aai.base.image>alpine</aai.base.image>
- <aai.base.image.version>1.8.1</aai.base.image.version>
+ <aai.base.image.version>1.13.2</aai.base.image.version>
+ <jacoco.line.coverage.limit>0.10</jacoco.line.coverage.limit>
<!-- This will be used for the docker images as the default format of maven build has issues -->
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
</properties>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-restlet</artifactId>
</exclusions>
</dependency>
- <!-- Camel BOM -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring-boot-dependencies</artifactId>
- <version>${camel-spring-boot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
- <!-- <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId>
- </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId>
- </dependency> -->
-
<!-- Camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
</dependency>
- <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-restlet -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-restlet</artifactId>
- </dependency>
-
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<artifactId>camel-servlet-starter</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
-
<dependency>
<groupId>org.onap.aai.sparky-be</groupId>
<artifactId>sparkybe-onap-service</artifactId>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>1.18.30</version>
+ <scope>provided</scope>
+ </dependency>
+
<!-- Test dependencies -->
<dependency>
</execution>
<execution>
<id>unpack</id>
- <phase>prepare-package</phase>
+ <phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<includes>/${shemaUnpackVersion}/oxm/</includes>
<outputDirectory>${aai.build.directory}</outputDirectory>
</artifactItem>
+ <artifactItem>
+ <groupId>org.onap.aai.schema-service</groupId>
+ <artifactId>aai-schema</artifactId>
+ <version>${version.aai-schema}</version>
+ <type>jar</type>
+ <outputDirectory>${project.basedir}/src/main/resources/schema/</outputDirectory>
+ <includes>**/oxm/**/*.xml</includes>
+ </artifactItem>
</artifactItems>
</configuration>
</execution>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.7</version>
<executions>
<execution>
<phase/>
#
cd $APP_HOME
-${JAVA_CMD} -Xms1024m -Xmx4096m $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar
+${JAVA_CMD} ${JVM_ARGS} $PROPS -jar ${APP_HOME}/lib/sparkybe-onap-application*.jar
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.aggregatevnf;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.aai.restclient.client.OperationResult;
+import org.onap.aai.sparky.entities.Aggregation;
+import org.onap.aai.sparky.entities.AggregationFilter;
+import org.onap.aai.sparky.entities.AggregationResult;
+import org.onap.aai.sparky.entities.AggregationsResponse;
+import org.onap.aai.sparky.entities.SearchServiceAggregationsResponse;
+import org.onap.aai.sparky.entities.Bucket;
+import org.onap.aai.sparky.entities.BucketResponse;
+import org.onap.aai.sparky.entities.FilterAggregationRequest;
+import org.onap.aai.sparky.entities.SearchResult;
+import org.onap.aai.sparky.search.SearchServiceAdapter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.web.client.RestClientException;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@ActiveProfiles({"test","oxm-default","oxm-schema-dev", "camel","fe-dev"})
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+public class AggregateSummaryProcessorTest {
+
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ @MockBean SearchServiceAdapter searchServiceAdapter;
+ @Mock OperationResult operationResult;
+
+ @Autowired
+ private TestRestTemplate restTemplate;
+
+ @Value("${schema.ingest.file}") String schemaIngestFileLocation;
+
+ @Test
+ public void someTest() throws RestClientException, JsonProcessingException {
+ when(searchServiceAdapter.doPost(Mockito.any(), Mockito.any())).thenReturn(operationResult);
+ when(operationResult.wasSuccessful()).thenReturn(true);
+
+ List<Aggregation> aggregationList = Arrays.asList(new Aggregation("someAggregation", Arrays.asList(new Bucket(1L,"someKey"))));
+ SearchServiceAggregationsResponse searchServiceAggregationsResponse = new SearchServiceAggregationsResponse(new SearchResult(1L), new AggregationResult(aggregationList), 1L);
+ when(operationResult.getResult()).thenReturn(objectMapper.writeValueAsString(searchServiceAggregationsResponse));
+
+ Map<String,String> params = new HashMap<String,String>();
+ AggregationFilter filter = new AggregationFilter("1","someOrchestrationStatus");
+ FilterAggregationRequest request = new FilterAggregationRequest(Arrays.asList(filter));
+
+ ResponseEntity<AggregationsResponse> response = restTemplate.postForEntity("/rest/search/filterAggregation", objectMapper.writeValueAsString(request), AggregationsResponse.class);
+ AggregationsResponse aggregationsResponse = response.getBody();
+ assertEquals(1L, aggregationsResponse.getTotal());
+ BucketResponse bucket = aggregationsResponse.getAggregations().get("someAggregation").get(0);
+ assertEquals("someKey", bucket.getKey());
+ assertEquals(0, bucket.getDocCount());
+
+ }
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import java.util.List;
+
+import lombok.Value;
+
+@Value
+public class Aggregation {
+ String name;
+ List<Bucket> buckets;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import lombok.Value;
+
+@Value
+public class AggregationFilter {
+ String filterId;
+ String filterValue;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import java.util.List;
+
+import lombok.Value;
+
+@Value
+public class AggregationResult {
+ List<Aggregation> aggregations;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import java.util.List;
+import java.util.Map;
+
+import lombok.Data;
+
+@Data
+public class AggregationsResponse {
+ long total;
+ Map<String, List<BucketResponse>> aggregations;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import lombok.Value;
+
+@Value
+public class Bucket {
+ long count;
+ String key;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import lombok.Data;
+
+@Data
+public class BucketResponse {
+ long docCount;
+ String key;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import java.util.List;
+
+import lombok.Value;
+
+@Value
+public class FilterAggregationRequest {
+ List<AggregationFilter> filters;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import lombok.Value;
+
+@Value
+public class SearchResult {
+ long totalHits;
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.aai
+ * ================================================================================
+ * Copyright © 2024 Deutsche Telekom Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.aai.sparky.entities;
+
+import lombok.Value;
+
+@Value
+public class SearchServiceAggregationsResponse {
+ SearchResult searchResult;
+ AggregationResult aggregationResult;
+ long totalHits;
+}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <parent>
+ <parent>
<groupId>org.onap.aai</groupId>
<artifactId>sparky-be</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
</parent>
<groupId>org.onap.aai.sparky-be</groupId>
<artifactId>sparkybe-onap-service</artifactId>
- <version>2.0.3-SNAPSHOT</version>
+ <version>2.0.5-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
-->
- <dependencies>
+<dependencies>
<!-- Spring dependencies -->
<dependency>
</exclusions>
</dependency>
-
- <!-- Camel BOM -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring-boot-dependencies</artifactId>
- <version>${camel-spring-boot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
- <!-- <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId>
- </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId>
- </dependency> -->
-
<!-- Camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
</dependency>
- <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-restlet -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-restlet</artifactId>
- </dependency>
-
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<artifactId>camel-servlet-starter</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
-
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
<dependency>
<groupId>commons-cli</groupId>
<scope>test</scope>
</dependency>
- </dependencies>
-
- <build>
+</dependencies>
+<build>
<pluginManagement>
<plugins>
-
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<release>11</release> <!--or <release>10</release>-->
</configuration>
</plugin>
-
-<!-- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-docker-file</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target</outputDirectory>
- <overwrite>true</overwrite>
- <resources>
- <resource>
- <directory>${basedir}/src/main/docker</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/scripts/</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin> -->
-
</plugins>
-
</pluginManagement>
<plugins>
-<!-- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- -->
-
- <!-- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-docker-file</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target</outputDirectory>
- <overwrite>true</overwrite>
- <resources>
- <resource>
- <directory>${basedir}/src/main/docker</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/bin/</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin> -->
-
-<!-- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <id>copy-installed</id>
- <phase>install</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${frontEndGroupdId}</groupId>
- <artifactId>${frontEndArtifactId}</artifactId>
- <version>${frontEndVersion}</version>
- <type>war</type>
- <outputDirectory>${basedir}/target/</outputDirectory>
- <destFileName>aai.war</destFileName>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
-
-<!-- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase />
- </execution>
- </executions>
- </plugin>
- -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
</reportPlugins>
</configuration>
</plugin>
-
- <!-- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-docker-file</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target</outputDirectory>
- <overwrite>true</overwrite>
- <resources>
- <resource>
- <directory>${basedir}/src/main/docker</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/scripts/</directory>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin> -->
-
-<!-- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.4.11</version>
- <configuration>
- <verbose>true</verbose>
- <serverId>docker-hub</serverId>
- <imageName>${docker.push.registry}/onap/${project.artifactId}</imageName>
- <dockerDirectory>${docker.location}</dockerDirectory>
- <imageTags>
- <imageTag>latest</imageTag>
- </imageTags>
- <forceTags>true</forceTags>
- </configuration>
- </plugin> -->
- <!-- license plugin -->
-<!-- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>3.0</version>
- <configuration>
- <header>LICENSE</header>
- <includes>
- <include>src/main/java/**</include>
- </includes>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>format</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
- -->
-<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.2</version>
- </plugin>
- </plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.2</version>
+ </plugin>
+ </plugins>
</build>
- <distributionManagement>
+<distributionManagement>
<repository>
<id>ecomp-releases</id>
<name>ECOMP Release Repository</name>
<id>ecomp-site</id>
<url>dav:${onap.nexus.url}${sitePath}</url>
</site>
- </distributionManagement>
+</distributionManagement>
- <repositories>
+<repositories>
<repository>
<id>central</id>
<name>Maven 2 repository 2</name>
<name>ECOMP Snapshot Repository</name>
<url>${onap.nexus.url}/content/repositories/snapshots/</url>
</repository>
- </repositories>
-
-
-
+</repositories>
</project>
import java.nio.file.Files;
import java.nio.file.Paths;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
private static final String FILE_URI = "file:";
private ResourceLoader resourceLoader;
- private String configHomeEnvVar;
+
+ @Value("${CONFIG_HOME}") private String configHomeEnvVar;
// private static Logger LOG = LoggerFactory.getInstance().getLogger(SparkyResourceLoader.class);
}
public String getFullFileUri(String uriFilePath) {
- return FILE_URI + System.getProperty(configHomeEnvVar) + uriFilePath;
+ return FILE_URI + configHomeEnvVar + "/" + uriFilePath;
}
public String getAbsolutePath(String uriFilePath) {
--- /dev/null
+CONFIG_HOME=./config
\ No newline at end of file
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties = {
-"schemaIngestPropLoc = src/test/resources/oxm-reader/schema-ingest-single-oxm.properties" })
+"schemaIngestPropLoc = src/test/resources/oxm-reader/schema-ingest-single-oxm.properties",
+"CONFIG_HOME = ./config" })
@ContextConfiguration(locations = { "classpath:oxm-reader/oxm-reader-bean.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(properties = {
-"schemaIngestPropLoc = src/test/resources/oxm-reader/schema-ingest-single-oxm.properties" })
+"schemaIngestPropLoc = src/test/resources/oxm-reader/schema-ingest-single-oxm.properties",
+"CONFIG_HOME = ./config" })
@ContextConfiguration(locations = { "classpath:oxm-reader/oxm-reader-bean.xml" })
-
-
public class BaseVisualizationContextTest {
private static SecureRandom secureRandom = new SecureRandom();
--- /dev/null
+CONFIG_HOME=./config
\ No newline at end of file
schema.version.related.link.start=v11
schema.version.app.root.start=v11
schema.version.namespace.change.start=v11
-schema.version.edge.label.start=v11
\ No newline at end of file
+schema.version.edge.label.start=v11
+
+CONFIG_HOME=./config
\ No newline at end of file
major=2
minor=0
-patch=3
+patch=5
base_version=${major}.${minor}.${patch}