Update Common Model and Context Builder API 19/64019/1
authorJennie Jia <Jennie.Jia@amdocs.com>
Fri, 31 Aug 2018 15:15:26 +0000 (15:15 +0000)
committerJennie Jia <Jennie.Jia@amdocs.com>
Fri, 31 Aug 2018 15:16:00 +0000 (15:16 +0000)
Issue-ID: LOG-640
Change-Id: I7d50dac7d5665edb56caa4985e4255308b9d8535
Signed-off-by: Jennie Jia <Jennie.Jia@amdocs.com>
pom.xml
src/main/java/org/onap/pomba/contextaggregator/datatypes/AggregatedModels.java
src/main/java/org/onap/pomba/contextaggregator/rest/RestRequest.java

diff --git a/pom.xml b/pom.xml
index 39de0a6..dda22d7 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 <?xml version="1.0"?>
 <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>
+  <modelVersion>4.0.0</modelVersion>
 
-       <groupId>org.onap.logging-analytics.pomba</groupId>
-       <artifactId>pomba-context-aggregator</artifactId>
-       <version>1.3.0-SNAPSHOT</version>
+  <groupId>org.onap.logging-analytics.pomba</groupId>
+  <artifactId>pomba-context-aggregator</artifactId>
+  <version>1.3.1-SNAPSHOT</version>
 
-       <parent>
-               <groupId>org.onap.oparent</groupId>
-               <artifactId>oparent</artifactId>
-               <version>1.2.0</version>
-               <relativePath/>
-       </parent>
+  <parent>
+    <groupId>org.onap.oparent</groupId>
+    <artifactId>oparent</artifactId>
+    <version>1.2.0</version>
+    <relativePath/>
+  </parent>
 
-       <properties>
-               <java.version>1.8</java.version>
-               <dmaap.client.version>1.1.5</dmaap.client.version>
-               <aai.rest.client.version>1.2.1</aai.rest.client.version>
-               <!--docker -->
-               <docker.tag>${project.version}-${timestamp}</docker.tag>
-               <docker.latest.tag>${project.version}-latest</docker.latest.tag>
-       </properties>
+  <properties>
+    <java.version>1.8</java.version>
+    <dmaap.client.version>1.1.5</dmaap.client.version>
+    <aai.rest.client.version>1.2.1</aai.rest.client.version>
+    <!--docker -->
+    <docker.tag>${project.version}-${timestamp}</docker.tag>
+    <docker.latest.tag>${project.version}-latest</docker.latest.tag>
+  </properties>
 
-       <dependencyManagement>
-               <dependencies>
-                       <dependency>
-                               <groupId>org.springframework.boot</groupId>
-                               <artifactId>spring-boot-dependencies</artifactId>
-                               <version>1.5.12.RELEASE</version>
-                               <type>pom</type>
-                               <scope>import</scope>
-                       </dependency>
-               </dependencies>
-       </dependencyManagement>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-dependencies</artifactId>
+        <version>1.5.12.RELEASE</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
 
-       <dependencies>
-               <dependency>
-                       <groupId>org.eclipse.jetty</groupId>
-                       <artifactId>jetty-security</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
-                       <artifactId>dmaapClient</artifactId>
-                       <version>${dmaap.client.version}</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.aai</groupId>
-                       <artifactId>rest-client</artifactId>
-                       <version>${aai.rest.client.version}</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.apache.logging.log4j</groupId>
-                                       <artifactId>log4j-slf4j-impl</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-web</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-actuator</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.logging-analytics.pomba</groupId>
-                       <artifactId>pomba-audit-common</artifactId>
-                       <version>1.3.0-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.google.code.gson</groupId>
-                       <artifactId>gson</artifactId>
-               </dependency>
-               <!-- logging dependencies -->
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>slf4j-api</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.logging-analytics</groupId>
-                       <artifactId>logging-slf4j</artifactId>
-                       <version>1.2.2-SNAPSHOT</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>com.att.eelf</groupId>
-                                       <artifactId>eelf-core</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
+  <dependencies>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-security</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
+      <artifactId>dmaapClient</artifactId>
+      <version>${dmaap.client.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.aai</groupId>
+      <artifactId>rest-client</artifactId>
+      <version>${aai.rest.client.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-slf4j-impl</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-actuator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.logging-analytics.pomba</groupId>
+      <artifactId>pomba-audit-common</artifactId>
+      <version>1.3.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+    </dependency>
+    <!-- logging dependencies -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.onap.logging-analytics</groupId>
+      <artifactId>logging-slf4j</artifactId>
+      <version>1.2.2-SNAPSHOT</version>
+      <exclusions>
+        <exclusion>
+          <groupId>com.att.eelf</groupId>
+          <artifactId>eelf-core</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
 
-               <!-- JUnit dependencies -->
-               <dependency>
-                       <groupId>junit</groupId>
-                       <artifactId>junit</artifactId>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework</groupId>
-                       <artifactId>spring-test</artifactId>
-                       <version>4.3.6.RELEASE</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-test</artifactId>
-                       <version>1.5.1.RELEASE</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.mockito</groupId>
-                       <artifactId>mockito-all</artifactId>
-                       <version>1.10.19</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-configuration-processor</artifactId>
-                       <optional>true</optional>
-               </dependency>
+    <!-- JUnit dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>4.3.6.RELEASE</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-test</artifactId>
+      <version>1.5.1.RELEASE</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <version>1.10.19</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-configuration-processor</artifactId>
+      <optional>true</optional>
+    </dependency>
 
-       </dependencies>
+  </dependencies>
 
-       <build>
-               <finalName>${project.artifactId}</finalName>
-               <plugins>
-                       <plugin>
-                               <groupId>org.springframework.boot</groupId>
-                               <artifactId>spring-boot-maven-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <goals>
-                                                       <goal>repackage</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
+  <build>
+    <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>repackage</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
 
-               <resources>
-                       <resource>
-                               <targetPath>config</targetPath>
-                               <directory>config</directory>
-                               <filtering>true</filtering>
-                               <includes>
-                                       <include>**/*</include>
-                               </includes>
-                       </resource>
-               </resources>
-       </build>
+    <resources>
+      <resource>
+        <targetPath>config</targetPath>
+        <directory>config</directory>
+        <filtering>true</filtering>
+        <includes>
+          <include>**/*</include>
+        </includes>
+      </resource>
+    </resources>
+  </build>
 
-       <profiles>
-               <profile>
-                       <id>docker</id>
-                       <build>
-                               <plugins>
-                                       <plugin>
-                                               <groupId>io.fabric8</groupId>
-                                               <artifactId>docker-maven-plugin</artifactId>
-                                               <version>0.19.1</version>
-                                               <configuration>
-                                                       <verbose>true</verbose>
-                                                       <apiVersion>1.23</apiVersion>
-                                                       <images>
-                                                               <image>
-                                                                       <name>onap/${project.artifactId}</name>
-                                                                       <alias>${project.artifactId}</alias>
-                                                                       <build>
-                                                                               <cleanup>try</cleanup>
-                                                                               <dockerFileDir>${project.basedir}/target/docker-stage</dockerFileDir>
-                                                                               <tags>
-                                                                                       <tag>${docker.snapshot.tag}</tag>
-                                                                                       <tag>${docker.latest.tag}</tag>
-                                                                               </tags>
-                                                                       </build>
-                                                               </image>
-                                                       </images>
-                                               </configuration>
-                                               <executions>
-                                                       <execution>
-                                                               <id>generate-images</id>
-                                                               <phase>generate-sources</phase>
-                                                               <goals>
-                                                                       <goal>build</goal>
-                                                               </goals>
-                                                       </execution>
-                                                       <execution>
-                                                               <id>push-images</id>
-                                                               <phase>deploy</phase>
-                                                               <goals>
-                                                                       <goal>build</goal>
-                                                                       <goal>push</goal>
-                                                               </goals>
-                                                       </execution>
-                                               </executions>
-                                       </plugin>
-                                       <plugin>
-                                               <artifactId>maven-resources-plugin</artifactId>
-                                               <version>2.6</version>
-                                               <executions>
-                                                       <execution>
-                                                               <id>copy-dockerfile</id>
-                                                               <goals>
-                                                                       <goal>copy-resources</goal>
-                                                               </goals><!-- here the phase you need -->
-                                                               <phase>package</phase>
-                                                               <configuration>
-                                                                       <outputDirectory>${project.basedir}/target/docker-stage</outputDirectory>
-                                                                       <resources>
-                                                                               <resource>
-                                                                                       <directory>src/main/docker</directory>
-                                                                                       <includes>
-                                                                                               <include>Dockerfile</include>
-                                                                                       </includes>
-                                                                                       <filtering>true</filtering>
-                                                                               </resource>
-                                                                       </resources>
-                                                               </configuration>
-                                                       </execution>
-                                                       <execution>
-                                                               <id>copy-properties</id>
-                                                               <goals>
-                                                                       <goal>copy-resources</goal>
-                                                               </goals>
-                                                               <phase>package</phase>
-                                                               <configuration>
-                                                                       <outputDirectory>${project.basedir}/target/docker-stage/config</outputDirectory>
-                                                                       <resources>
-                                                                               <resource>
-                                                                                       <directory>config</directory>
-                                                                                       <includes>
-                                                                                               <include>*.properties</include>
-                                                                                               <include>builders/*.properties</include>
-                                                                                               <include>*.xml</include>
-                                                                                       </includes>
-                                                                                       <filtering>false</filtering>
-                                                                               </resource>
-                                                                       </resources>
-                                                               </configuration>
-                                                       </execution>
-                                                       <execution>
-                                                               <id>copy-script</id>
-                                                               <goals>
-                                                                       <goal>copy-resources</goal>
-                                                               </goals>
-                                                               <phase>package</phase>
-                                                               <configuration>
-                                                                       <outputDirectory>${project.basedir}/target/docker-stage/</outputDirectory>
-                                                                       <resources>
-                                                                               <resource>
-                                                                                       <directory>src/main/docker</directory>
-                                                                                       <includes>
-                                                                                               <include>*.sh</include>
-                                                                                       </includes>
-                                                                                       <filtering>false</filtering>
-                                                                               </resource>
-                                                                       </resources>
-                                                               </configuration>
-                                                       </execution>
-                                                       <execution>
-                                                               <id>copy-jar</id>
-                                                               <goals>
-                                                                       <goal>copy-resources</goal>
-                                                               </goals>
-                                                               <phase>package</phase>
-                                                               <configuration>
-                                                                       <outputDirectory>${project.basedir}/target/docker-stage/</outputDirectory>
-                                                                       <resources>
-                                                                               <resource>
-                                                                                       <directory>target</directory>
-                                                                                       <includes>
-                                                                                               <include>*.jar</include>
-                                                                                       </includes>
-                                                                                       <filtering>false</filtering>
-                                                                               </resource>
-                                                                       </resources>
-                                                               </configuration>
-                                                       </execution>
-                                               </executions>
-                                       </plugin>
-                               </plugins>
-                       </build>
-               </profile>
-       </profiles>
+  <profiles>
+    <profile>
+      <id>docker</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>io.fabric8</groupId>
+            <artifactId>docker-maven-plugin</artifactId>
+            <version>0.19.1</version>
+            <configuration>
+              <verbose>true</verbose>
+              <apiVersion>1.23</apiVersion>
+              <images>
+                <image>
+                  <name>onap/${project.artifactId}</name>
+                  <alias>${project.artifactId}</alias>
+                  <build>
+                    <cleanup>try</cleanup>
+                    <dockerFileDir>${project.basedir}/target/docker-stage</dockerFileDir>
+                    <tags>
+                      <tag>${docker.snapshot.tag}</tag>
+                      <tag>${docker.latest.tag}</tag>
+                    </tags>
+                  </build>
+                </image>
+              </images>
+            </configuration>
+            <executions>
+              <execution>
+                <id>generate-images</id>
+                <phase>generate-sources</phase>
+                <goals>
+                  <goal>build</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>push-images</id>
+                <phase>deploy</phase>
+                <goals>
+                  <goal>build</goal>
+                  <goal>push</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-dockerfile</id>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals><!-- here the phase you need -->
+                <phase>package</phase>
+                <configuration>
+                  <outputDirectory>${project.basedir}/target/docker-stage</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>src/main/docker</directory>
+                      <includes>
+                        <include>Dockerfile</include>
+                      </includes>
+                      <filtering>true</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+              <execution>
+                <id>copy-properties</id>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <phase>package</phase>
+                <configuration>
+                  <outputDirectory>${project.basedir}/target/docker-stage/config</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>config</directory>
+                      <includes>
+                        <include>*.properties</include>
+                        <include>builders/*.properties</include>
+                        <include>*.xml</include>
+                      </includes>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+              <execution>
+                <id>copy-script</id>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <phase>package</phase>
+                <configuration>
+                  <outputDirectory>${project.basedir}/target/docker-stage/</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>src/main/docker</directory>
+                      <includes>
+                        <include>*.sh</include>
+                      </includes>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+              <execution>
+                <id>copy-jar</id>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <phase>package</phase>
+                <configuration>
+                  <outputDirectory>${project.basedir}/target/docker-stage/</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>target</directory>
+                      <includes>
+                        <include>*.jar</include>
+                      </includes>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
index 5648b91..552e4ba 100644 (file)
@@ -53,7 +53,7 @@ public class AggregatedModels {
             ModelContext context = null;
             if (entry.getValue().isEmpty()) {
                 context = new ModelContext();
-                context.setVf(null);
+                context.setVfs(null);
             } else {
                 context = gson.fromJson(entry.getValue(), ModelContext.class);
             }
index cacc8e6..6ec63f7 100644 (file)
@@ -38,9 +38,7 @@ public class RestRequest {
 
     private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
     private static final String MODEL_VERSION_ID = "modelVersionId";
-    private static final String MODE_INVARIANT_ID = "modelInvariantId";
-    private static final String CUSTOMER_ID = "customerId";
-    private static final String SERVICE_TYPE = "serviceType";
+    private static final String MODEL_INVARIANT_ID = "modelInvariantId";
 
     private static final String APP_NAME = "context-aggregator";
 
@@ -91,9 +89,7 @@ public class RestRequest {
                 .host(builder.getHost()).port(builder.getPort()).path(builder.getBaseUri())
                 .queryParam(SERVICE_INSTANCE_ID, event.getServiceInstanceId())
                 .queryParam(MODEL_VERSION_ID, event.getModelVersionId())
-                .queryParam(MODE_INVARIANT_ID, event.getModelInvariantId())
-                .queryParam(SERVICE_TYPE, event.getServiceType()).queryParam(CUSTOMER_ID, event.getCustomerId()).build()
-                .encode();
+                .queryParam(MODEL_INVARIANT_ID, event.getModelInvariantId()).build().encode();
         return uriComponents.toUriString();
     }