Upgrade to E2 spec of 2 May 2019 99/99/6
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 1 May 2019 22:59:10 +0000 (18:59 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 2 May 2019 17:22:05 +0000 (13:22 -0400)
Use o-ran-sc in groupId strings.
Adjust java package names similarly.
Bump version to 1.0.1.

Change-Id: I8385916c53a6ee3e6de81d8e95510f4e14738d1d
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
30 files changed:
docs/release-notes.rst
e2-mgr-client/pom.xml
e2-mgr-client/src/main/resources/e2_manager_02052019.yaml [new file with mode: 0644]
e2-mgr-client/src/test/java/org/oransc/ric/portal/dashboard/e2mgr/client/test/E2ManagerClientTest.java [moved from e2-mgr-client/src/test/java/org/oranosc/ric/portal/dashboard/e2mgr/demo/E2ManagerClientTest.java with 84% similarity]
pom.xml
webapp-backend/pom.xml
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardApplication.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/DashboardApplication.java with 95% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardConstants.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/DashboardConstants.java with 95% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerConfiguration.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java with 76% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java with 62% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/SwaggerConfiguration.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/SwaggerConfiguration.java with 95% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerConfiguration.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java with 93% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerMockConfiguration.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java with 86% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1MediationController.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/A1MediationController.java with 93% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java with 72% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/SimpleErrorController.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/SimpleErrorController.java with 98% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/XappManagerController.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java with 91% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DelayTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/DelayTransport.java with 96% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/ErrorTransport.java with 98% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/IDashboardResponse.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/IDashboardResponse.java with 95% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/LoadTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/LoadTransport.java with 96% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/MetricsTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/MetricsTransport.java with 97% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PathTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/PathTransport.java with 96% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/SuccessTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/SuccessTransport.java with 96% similarity]
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/UrlTransport.java [moved from webapp-backend/src/main/java/org/oranosc/ric/portal/dash/model/UrlTransport.java with 96% similarity]
webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DashboardApplicationTest.java [moved from webapp-backend/src/test/java/org/oranosc/ric/portal/dash/DashboardApplicationTest.java with 96% similarity]
webapp-frontend/pom.xml
xapp-mgr-client/pom.xml
xapp-mgr-client/src/main/resources/.gitignore [new file with mode: 0644]
xapp-mgr-client/src/test/java/org/oransc/ric/portal/dashboard/xappmgr/client/test/XappManagerClientTest.java [moved from xapp-mgr-client/src/test/java/org/oranosc/ric/portal/dashboard/xmc/demo/XappManagerClientTest.java with 78% similarity]

index 05e1c23..5d37d36 100644 (file)
 RIC Dashboard Release Notes
 ===========================
 
+Version 1.0.1, 2 May 2019
+-------------------------
+* Use E2 Manager API definition dated 2 May 2019
+
 Version 1.0.0, 30 Apr 2019
 --------------------------
 * Initial version
index 372f9da..6e213c7 100644 (file)
@@ -23,26 +23,26 @@ limitations under the License.
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
-               <groupId>org.oranosc.ric.portal.dashboard</groupId>
+               <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.0-SNAPSHOT</version>
+               <version>1.0.1-SNAPSHOT</version>
        </parent>
-       <groupId>org.oranosc.ric.e2mgr.client</groupId>
+       <!-- This groupId will NOT allow deployment in LF -->
+       <groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
        <artifactId>e2-mgr-client</artifactId>
        <name>RIC E2 Manager client</name>
-       <version>0.0.1-SNAPSHOT</version>
+       <version>02052019-SNAPSHOT</version>
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <swagger-annotations-version>1.5.15</swagger-annotations-version>
-               <client.base.package.name>org.oranosc.ric.e2mgr.client</client.base.package.name>
+               <client.base.package.name>org.oransc.ric.e2mgr.client</client.base.package.name>
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
                <dependency>
-                       <groupId>io.swagger</groupId>
+                       <groupId>io.swagger.core.v3</groupId>
                        <artifactId>swagger-annotations</artifactId>
-                       <version>${swagger-annotations-version}</version>
+                       <version>2.0.8</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
@@ -91,40 +91,32 @@ limitations under the License.
        <build>
                <plugins>
                        <plugin>
-                               <groupId>io.swagger</groupId>
+                               <!-- This 2019 version is required for OpenAPI 3 -->
+                               <groupId>io.swagger.codegen.v3</groupId>
                                <artifactId>swagger-codegen-maven-plugin</artifactId>
-                               <version>2.4.5</version>
+                               <version>3.0.8</version>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>generate</goal>
                                                </goals>
                                                <configuration>
-                                                       <inputSpec>${project.basedir}/src/main/resources/e2_mgr_rest_api_v0_0_1.yaml</inputSpec>
+                                                       <inputSpec>${project.basedir}/src/main/resources/e2_manager_02052019.yaml</inputSpec>
                                                        <language>java</language>
+                                                       <packageName>${client.base.package.name}</packageName>
+                                                       <modelPackage>${client.base.package.name}.model</modelPackage>
+                                                       <apiPackage>${client.base.package.name}.api</apiPackage>
+                                                       <invokerPackage>${client.base.package.name}.invoker</invokerPackage>
                                                        <configOptions>
                                                                <groupId>${project.groupId}</groupId>
                                                                <artifactId>${project.artifactId}</artifactId>
                                                                <artifactVersion>${project.version}</artifactVersion>
-                                                               <artifactUrl>www.oran-osc.org</artifactUrl>
-                                                               <artifactDescription>E2 manager client library</artifactDescription>
                                                                <library>resttemplate</library>
                                                                <java8>true</java8>
                                                                <dateLibrary>java8</dateLibrary>
                                                                <licenseName>Apache 2.0</licenseName>
                                                                <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
-                                                               <scmConnection></scmConnection>
-                                                               <scmDeveloperConnection></scmDeveloperConnection>
-                                                               <scmUrl>http://gerrit.oran-osc.org</scmUrl>
-                                                               <developerName>RIC Team</developerName>
-                                                               <developerEmail></developerEmail>
-                                                               <developerOrganization>AT&amp;T and Nokia</developerOrganization>
-                                                               <developerOrganizationUrl></developerOrganizationUrl>
                                                        </configOptions>
-                                                       <packageName>${client.base.package.name}</packageName>
-                                                       <modelPackage>${client.base.package.name}.model</modelPackage>
-                                                       <apiPackage>${client.base.package.name}.api</apiPackage>
-                                                       <invokerPackage>${client.base.package.name}.invoker</invokerPackage>
                                                </configuration>
                                        </execution>
                                </executions>
@@ -190,7 +182,7 @@ limitations under the License.
                                                        <pluginExecutions>
                                                                <pluginExecution>
                                                                        <pluginExecutionFilter>
-                                                                               <groupId>io.swagger</groupId>
+                                                                               <groupId>io.swagger.codegen.v3</groupId>
                                                                                <artifactId>swagger-codegen-maven-plugin</artifactId>
                                                                                <versionRange>[1.0,)</versionRange>
                                                                                <goals>
diff --git a/e2-mgr-client/src/main/resources/e2_manager_02052019.yaml b/e2-mgr-client/src/main/resources/e2_manager_02052019.yaml
new file mode 100644 (file)
index 0000000..3846b38
--- /dev/null
@@ -0,0 +1,147 @@
+# ========================LICENSE_START=================================
+# ORAN-OSC
+# %%
+# Copyright (C) 2019 AT&T Intellectual Property and Nokia
+# %%
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this 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===================================
+openapi: 3.0.0
+info:
+  title: E2 Manager Service
+  description: This is a description of E2 manager service APIs
+  version: 1.0.0
+servers:
+  - url: http://{apiRoot}/nodeb/v1
+    variables:
+      apiRoot:
+        default: localhost:3800
+        description: >-
+           E2 manager
+paths:
+  /setup:
+    post:
+      summary: X2 Setup Request
+      tags:
+        - X2 Setup Request
+      operationId: setup
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/SetupRequest'
+        required: true
+      responses:
+        '200':
+          description: Request was handled successfuly
+        '400':
+          description: Invalid input
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        '404':
+          description: Resource not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        '500':
+          description: Internal server error
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        default:
+          description: Unexpected error
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+
+  /endcSetup:
+    post:
+      tags:
+        - ENDC Setup Request
+      summary: ENDC Setup Request
+      operationId: endcSetup
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/SetupRequest'
+        required: true
+      responses:
+        '200':
+          description: Request was handled successfuly
+        '400':
+          description: Invalid input
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        '404':
+          description: Resource not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        '500':
+          description: Internal server error
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+        default:
+          description: Unexpected error
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ErrorResponse'
+
+  /health:
+    get:
+      tags:
+        - Health Check
+      summary: E2 Manager Service Health Check
+      operationId: healthCheck
+      responses:
+        '200':
+          description: OK
+components:
+  schemas:
+    SetupRequest:
+      type: object
+      required:
+        - ranIp
+        - ranPort
+        - ranName
+      properties:
+        ranIp:
+          type: string
+        ranPort:
+          type: integer
+          format: uint16
+        ranName:
+          type: string
+    ErrorResponse:
+      type: object
+      required:
+        - errorCode
+        - errorMessage
+      properties:
+        errorCode:
+          type: string
+          description: 401 - corrupted json, 402 - validation error, 501 - internal problem
+        errorMessage:
+          type: string
+          description: Human readable text
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dashboard.e2mgr.demo;
+package org.oransc.ric.portal.dashboard.e2mgr.client.test;
 
 import org.junit.jupiter.api.Test;
-import org.oranosc.ric.e2mgr.client.api.DefaultApi;
-import org.oranosc.ric.e2mgr.client.invoker.ApiClient;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
+import org.oransc.ric.e2mgr.client.invoker.ApiClient;
 import org.springframework.web.client.RestClientException;
 
 /**
@@ -35,9 +35,9 @@ public class E2ManagerClientTest {
        public void demo() {
                ApiClient apiClient = new ApiClient();
                apiClient.setBasePath("http://localhost:30099/");
-               DefaultApi e2Mgr = new DefaultApi(apiClient);
+               HealthCheckApi e2Health = new HealthCheckApi(apiClient);
                try {
-                       e2Mgr.getHealth();
+                       e2Health.healthCheck();
                        System.out.println("getHealth answered: " + apiClient.getStatusCode().toString());
                } catch (RestClientException e) {
                        System.err.println("getHealth failed: " + e.toString());
diff --git a/pom.xml b/pom.xml
index 9928ca0..93842b0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -25,14 +25,14 @@ limitations under the License.
        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
-               <version>2.1.3.RELEASE</version>
+               <version>2.1.4.RELEASE</version>
                <relativePath /> <!-- lookup parent from repository -->
        </parent>
-       <groupId>org.oranosc.ric.portal.dashboard</groupId>
+       <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
        <artifactId>ric-dash-parent</artifactId>
        <name>RIC Dashboard project</name>
        <packaging>pom</packaging>
-       <version>1.0.0-SNAPSHOT</version>
+       <version>1.0.1-SNAPSHOT</version>
        <!-- Properties for the license-maven-plugin in child POMs -->
        <properties>
                <lmp.organization.name>AT&amp;T Intellectual Property and Nokia</lmp.organization.name>
index 3b06ab9..6f7147c 100644 (file)
@@ -23,9 +23,9 @@ limitations under the License.
        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>
-               <groupId>org.oranosc.ric.portal.dashboard</groupId>
+               <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.0-SNAPSHOT</version>
+               <version>1.0.1-SNAPSHOT</version>
        </parent>
        <artifactId>ric-dash-be</artifactId>
        <name>RIC Dashboard Webapp backend</name>
@@ -36,12 +36,12 @@ limitations under the License.
        </properties>
        <dependencies>
                <dependency>
-                       <groupId>org.oranosc.ric.e2mgr.client</groupId>
+                       <groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
                        <artifactId>e2-mgr-client</artifactId>
-                       <version>0.0.1-SNAPSHOT</version>
+                       <version>02052019-SNAPSHOT</version>
                </dependency>
                <dependency>
-                       <groupId>org.oranosc.ric.xappmgr.client</groupId>
+                       <groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
                        <artifactId>xapp-mgr-client</artifactId>
                        <version>0.0.10-SNAPSHOT</version>
                </dependency>
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash;
+package org.oransc.ric.portal.dashboard;
 
 import java.lang.invoke.MethodHandles;
 
@@ -30,7 +30,7 @@ import org.springframework.context.annotation.ComponentScan;
 @SpringBootApplication
 // Limit the annotation scan to the dashboard classes;
 // exclude the generated client classes!
-@ComponentScan("org.oranosc.ric.portal.dash")
+@ComponentScan("org.oransc.ric.portal.dashboard")
 public class DashboardApplication {
 
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash;
+package org.oransc.ric.portal.dashboard;
 
 public abstract class DashboardConstants {
 
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.config;
+package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
 
-import org.oranosc.ric.e2mgr.client.api.DefaultApi;
-import org.oranosc.ric.e2mgr.client.invoker.ApiClient;
+import org.oransc.ric.e2mgr.client.api.EndcSetupRequestApi;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
+import org.oransc.ric.e2mgr.client.api.X2SetupRequestApi;
+import org.oransc.ric.e2mgr.client.invoker.ApiClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,14 +54,25 @@ public class E2ManagerConfiguration {
                this.e2mgrBasepath = e2mgrBasepath;
        }
 
-       /**
-        * @return A DefaultApi with an ApiClient configured from properties
-        */
-       @Bean
-       public DefaultApi e2ManagerClient() {
+       private ApiClient apiClient() {
                ApiClient apiClient = new ApiClient(new RestTemplate());
                apiClient.setBasePath(e2mgrBasepath);
-               return new DefaultApi(apiClient);
+               return apiClient;
+       }
+
+       @Bean
+       public EndcSetupRequestApi endcSetupRequestApi() {
+               return new EndcSetupRequestApi(apiClient());
+       }
+
+       @Bean
+       public HealthCheckApi healthCheckApi() {
+               return new HealthCheckApi(apiClient());
+       }
+
+       @Bean
+       public X2SetupRequestApi x2SetupRequestApi() {
+               return new X2SetupRequestApi(apiClient());
        }
 
 }
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.config;
+package org.oransc.ric.portal.dashboard.config;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
@@ -26,9 +26,11 @@ import static org.mockito.Mockito.when;
 
 import java.lang.invoke.MethodHandles;
 
-import org.oranosc.ric.e2mgr.client.api.DefaultApi;
-import org.oranosc.ric.e2mgr.client.invoker.ApiClient;
-import org.oranosc.ric.e2mgr.client.model.RanSetupRequest;
+import org.oransc.ric.e2mgr.client.api.EndcSetupRequestApi;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
+import org.oransc.ric.e2mgr.client.api.X2SetupRequestApi;
+import org.oransc.ric.e2mgr.client.invoker.ApiClient;
+import org.oransc.ric.e2mgr.client.model.SetupRequest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
@@ -50,22 +52,39 @@ public class E2ManagerMockConfiguration {
                logger.info("Configuring mock E2 Manager");
        }
 
-       @Bean
-       public DefaultApi e2ManagerMockClient() {
+       private ApiClient apiClient() {
                ApiClient mockClient = mock(ApiClient.class);
                when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
+               return mockClient;
+       }
 
-               DefaultApi mockApi = mock(DefaultApi.class);
-               when(mockApi.getApiClient()).thenReturn(mockClient);
+       @Bean
+       public EndcSetupRequestApi endcSetupRequestApi() {
+               ApiClient apiClient = apiClient();
+               EndcSetupRequestApi mockApi = mock(EndcSetupRequestApi.class);
+               when(mockApi.getApiClient()).thenReturn(apiClient);
+               return mockApi;
+       }
 
+       @Bean
+       public HealthCheckApi healthCheckApi() {
+               ApiClient apiClient = apiClient();
+               HealthCheckApi mockApi = mock(HealthCheckApi.class);
+               when(mockApi.getApiClient()).thenReturn(apiClient);
                doAnswer(i -> {
                        return null;
-               }).when(mockApi).getHealth();
+               }).when(mockApi).healthCheck();
+               return mockApi;
+       }
 
+       @Bean
+       public X2SetupRequestApi x2SetupRequestApi() {
+               ApiClient apiClient = apiClient();
+               X2SetupRequestApi mockApi = mock(X2SetupRequestApi.class);
+               when(mockApi.getApiClient()).thenReturn(apiClient);
                doAnswer(i -> {
                        return null;
-               }).when(mockApi).setupRan(any(RanSetupRequest.class));
-
+               }).when(mockApi).setup(any(SetupRequest.class));
                return mockApi;
        }
 
@@ -18,9 +18,9 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.config;
+package org.oransc.ric.portal.dashboard.config;
 
-import org.oranosc.ric.portal.dash.DashboardApplication;
+import org.oransc.ric.portal.dashboard.DashboardApplication;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.config;
+package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
 
-import org.oranosc.ric.xappmgr.client.api.DefaultApi;
-import org.oranosc.ric.xappmgr.client.invoker.ApiClient;
+import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.invoker.ApiClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.config;
+package org.oransc.ric.portal.dashboard.config;
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doAnswer;
@@ -26,14 +26,14 @@ import static org.mockito.Mockito.when;
 
 import java.lang.invoke.MethodHandles;
 
-import org.oranosc.ric.xappmgr.client.api.DefaultApi;
-import org.oranosc.ric.xappmgr.client.invoker.ApiClient;
-import org.oranosc.ric.xappmgr.client.model.AllXapps;
-import org.oranosc.ric.xappmgr.client.model.SubscriptionRequest;
-import org.oranosc.ric.xappmgr.client.model.SubscriptionResponse;
-import org.oranosc.ric.xappmgr.client.model.XAppInfo;
-import org.oranosc.ric.xappmgr.client.model.Xapp;
-import org.oranosc.ric.xappmgr.client.model.Xapp.StatusEnum;
+import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.invoker.ApiClient;
+import org.oransc.ric.xappmgr.client.model.AllXapps;
+import org.oransc.ric.xappmgr.client.model.SubscriptionRequest;
+import org.oransc.ric.xappmgr.client.model.SubscriptionResponse;
+import org.oransc.ric.xappmgr.client.model.XAppInfo;
+import org.oransc.ric.xappmgr.client.model.Xapp;
+import org.oransc.ric.xappmgr.client.model.Xapp.StatusEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.controller;
+package org.oransc.ric.portal.dashboard.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.net.MalformedURLException;
@@ -26,15 +26,15 @@ import java.net.URL;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.oranosc.ric.portal.dash.DashboardConstants;
-import org.oranosc.ric.portal.dash.model.DelayTransport;
-import org.oranosc.ric.portal.dash.model.ErrorTransport;
-import org.oranosc.ric.portal.dash.model.IDashboardResponse;
-import org.oranosc.ric.portal.dash.model.LoadTransport;
-import org.oranosc.ric.portal.dash.model.MetricsTransport;
-import org.oranosc.ric.portal.dash.model.PathTransport;
-import org.oranosc.ric.portal.dash.model.SuccessTransport;
-import org.oranosc.ric.portal.dash.model.UrlTransport;
+import org.oransc.ric.portal.dashboard.DashboardConstants;
+import org.oransc.ric.portal.dashboard.model.DelayTransport;
+import org.oransc.ric.portal.dashboard.model.ErrorTransport;
+import org.oransc.ric.portal.dashboard.model.IDashboardResponse;
+import org.oransc.ric.portal.dashboard.model.LoadTransport;
+import org.oransc.ric.portal.dashboard.model.MetricsTransport;
+import org.oransc.ric.portal.dashboard.model.PathTransport;
+import org.oransc.ric.portal.dashboard.model.SuccessTransport;
+import org.oransc.ric.portal.dashboard.model.UrlTransport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.controller;
+package org.oransc.ric.portal.dashboard.controller;
 
 import java.lang.invoke.MethodHandles;
 import java.util.HashSet;
@@ -25,9 +25,10 @@ import java.util.Set;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.oranosc.ric.e2mgr.client.api.DefaultApi;
-import org.oranosc.ric.e2mgr.client.model.RanSetupRequest;
-import org.oranosc.ric.portal.dash.DashboardConstants;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
+import org.oransc.ric.e2mgr.client.api.X2SetupRequestApi;
+import org.oransc.ric.e2mgr.client.model.SetupRequest;
+import org.oransc.ric.portal.dashboard.DashboardConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,18 +57,18 @@ public class E2ManagerController {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        // Populated by the autowired constructor
-       private final DefaultApi e2MgrClient;
+       private final HealthCheckApi healthCheckApi;
+       private final X2SetupRequestApi x2SetupRequestApi;
 
        // Tracks the requests previously submitted.
        // TODO remove when the E2 manager is extended.
-       private Set<RanSetupRequest> requests = new HashSet<>();
+       private Set<SetupRequest> requests = new HashSet<>();
 
        @Autowired
-       public E2ManagerController(final DefaultApi e2MgrClient) {
-               Assert.notNull(e2MgrClient, "client must not be null");
-               if (logger.isDebugEnabled())
-                       logger.debug("ctor: configured with client type {}", e2MgrClient.getClass().getName());
-               this.e2MgrClient = e2MgrClient;
+       public E2ManagerController(final HealthCheckApi healthCheckApi, final X2SetupRequestApi x2SetupRequestApi) {
+               Assert.notNull(healthCheckApi, "API must not be null");
+               this.healthCheckApi = healthCheckApi;
+               this.x2SetupRequestApi = x2SetupRequestApi;
        }
 
        private void assertNotNull(Object o) {
@@ -85,32 +86,32 @@ public class E2ManagerController {
        @RequestMapping(value = "/health", method = RequestMethod.GET)
        public void getHealth(HttpServletResponse response) {
                logger.debug("getHealth");
-               e2MgrClient.getHealth();
-               response.setStatus(e2MgrClient.getApiClient().getStatusCode().value());
+               healthCheckApi.healthCheck();
+               response.setStatus(healthCheckApi.getApiClient().getStatusCode().value());
        }
 
-       @ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = RanSetupRequest.class, responseContainer = "List")
+       @ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = SetupRequest.class, responseContainer = "List")
        @RequestMapping(value = "/setup", method = RequestMethod.GET)
-       public Iterable<RanSetupRequest> getRequests() {
+       public Iterable<SetupRequest> getRequests() {
                logger.debug("getRequests");
                return requests;
        }
 
        @ApiOperation(value = "Sets up a RAN connection via the E2 manager.")
        @RequestMapping(value = "/setup", method = RequestMethod.POST)
-       public void setup(@RequestBody RanSetupRequest rsr, HttpServletResponse response) {
-               logger.debug("setup {}", rsr);
+       public void setup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
+               logger.debug("setup {}", setupRequest);
                try {
-                       assertNotEmpty(rsr.getRanIp());
-                       assertNotEmpty(rsr.getRanName());
-                       assertNotNull(rsr.getRanPort());
+                       assertNotEmpty(setupRequest.getRanIp());
+                       assertNotEmpty(setupRequest.getRanName());
+                       assertNotNull(setupRequest.getRanPort());
                } catch (Exception ex) {
                        logger.error("Bad request", ex);
                        response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                }
                try {
-                       requests.add(rsr);
-                       e2MgrClient.setupRan(rsr);
+                       requests.add(setupRequest);
+                       x2SetupRequestApi.setup(setupRequest);
                } catch (Exception ex) {
                        logger.error("Failed", ex);
                        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.controller;
+package org.oransc.ric.portal.dashboard.controller;
 
 import java.lang.invoke.MethodHandles;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.oranosc.ric.portal.dash.DashboardConstants;
-import org.oranosc.ric.portal.dash.model.ErrorTransport;
-import org.oranosc.ric.xappmgr.client.api.DefaultApi;
-import org.oranosc.ric.xappmgr.client.model.AllXapps;
-import org.oranosc.ric.xappmgr.client.model.XAppInfo;
-import org.oranosc.ric.xappmgr.client.model.Xapp;
+import org.oransc.ric.portal.dashboard.DashboardConstants;
+import org.oransc.ric.portal.dashboard.model.ErrorTransport;
+import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.model.AllXapps;
+import org.oransc.ric.xappmgr.client.model.XAppInfo;
+import org.oransc.ric.xappmgr.client.model.Xapp;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Trivial model to transport a number, to be serialized as JSON.
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Model for message returned on failure, to be serialized as JSON.
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Marker interface used by all transport models.
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Trivial model to transport a number, to be serialized as JSON.
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Trivial model to transport a batch of numbers, to be serialized as JSON.
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Trivial model to transport a path, to be serialized as JSON.
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 public class SuccessTransport implements IDashboardResponse {
 
@@ -18,7 +18,7 @@
  * ========================LICENSE_END===================================
  */
 
-package org.oranosc.ric.portal.dash.model;
+package org.oransc.ric.portal.dashboard.model;
 
 /**
  * Trivial model to transport a URL, to be serialized as JSON.
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dash;
+package org.oransc.ric.portal.dashboard;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
index d386e5b..e738a12 100644 (file)
@@ -22,20 +22,24 @@ limitations under the License.
        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>
-                <groupId>org.oranosc.ric.portal.dashboard</groupId>
-                <artifactId>ric-dash-parent</artifactId>
-                <version>1.0.0-SNAPSHOT</version>
-        </parent>
+       <parent>
+               <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
+               <artifactId>ric-dash-parent</artifactId>
+               <version>1.0.1-SNAPSHOT</version>
+       </parent>
        <artifactId>ric-dash-fe</artifactId>
-        <name>RIC Dashboard Webapp frontend</name>
+       <name>RIC Dashboard Webapp frontend</name>
+       <properties>
+               <!-- No java here so skip javadoc -->
+               <maven.javadoc.skip>true</maven.javadoc.skip>
+       </properties>
        <build>
                <plugins>
                        <!-- do not deploy anything -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-deploy-plugin</artifactId>
-                               <!--  spring sets the <version>2.8</version> -->
+                               <!-- spring sets the <version>2.8</version> -->
                                <configuration>
                                        <skip>true</skip>
                                </configuration>
index ad034ad..3f468a9 100644 (file)
@@ -23,26 +23,26 @@ limitations under the License.
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
-               <groupId>org.oranosc.ric.portal.dashboard</groupId>
+               <groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
                <artifactId>ric-dash-parent</artifactId>
-               <version>1.0.0-SNAPSHOT</version>
+               <version>1.0.1-SNAPSHOT</version>
        </parent>
-       <groupId>org.oranosc.ric.xappmgr.client</groupId>
+       <!-- This groupId will NOT allow deployment in LF -->
+       <groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
        <artifactId>xapp-mgr-client</artifactId>
        <name>RIC xApp Manager client</name>
        <version>0.0.10-SNAPSHOT</version>
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <swagger-annotations-version>1.5.15</swagger-annotations-version>
-               <client.base.package.name>org.oranosc.ric.xappmgr.client</client.base.package.name>
+               <client.base.package.name>org.oransc.ric.xappmgr.client</client.base.package.name>
        </properties>
        <!-- Successful compilation requires generated code dependencies -->
        <dependencies>
                <dependency>
                        <groupId>io.swagger</groupId>
                        <artifactId>swagger-annotations</artifactId>
-                       <version>${swagger-annotations-version}</version>
+                       <version>1.5.15</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
@@ -91,6 +91,7 @@ limitations under the License.
        <build>
                <plugins>
                        <plugin>
+                               <!-- This version works fine on Swagger 2.0 -->
                                <groupId>io.swagger</groupId>
                                <artifactId>swagger-codegen-maven-plugin</artifactId>
                                <version>2.4.5</version>
@@ -113,13 +114,6 @@ limitations under the License.
                                                                <dateLibrary>java8</dateLibrary>
                                                                <licenseName>Apache 2.0</licenseName>
                                                                <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
-                                                               <scmConnection></scmConnection>
-                                                               <scmDeveloperConnection></scmDeveloperConnection>
-                                                               <scmUrl>http://gerrit.oran-osc.org</scmUrl>
-                                                               <developerName>RIC Team</developerName>
-                                                               <developerEmail></developerEmail>
-                                                               <developerOrganization>AT&amp;T and Nokia</developerOrganization>
-                                                               <developerOrganizationUrl></developerOrganizationUrl>
                                                        </configOptions>
                                                        <packageName>${client.base.package.name}</packageName>
                                                        <modelPackage>${client.base.package.name}.model</modelPackage>
diff --git a/xapp-mgr-client/src/main/resources/.gitignore b/xapp-mgr-client/src/main/resources/.gitignore
new file mode 100644 (file)
index 0000000..de73726
--- /dev/null
@@ -0,0 +1 @@
+xapp_manager_rest_api_v0_0_10.yaml
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-package org.oranosc.ric.portal.dashboard.xmc.demo;
+package org.oransc.ric.portal.dashboard.xappmgr.client.test;
 
 import org.junit.jupiter.api.Test;
-import org.oranosc.ric.xappmgr.client.api.DefaultApi;
-import org.oranosc.ric.xappmgr.client.invoker.ApiClient;
-import org.oranosc.ric.xappmgr.client.model.AllXapps;
-import org.oranosc.ric.xappmgr.client.model.Xapp;
+import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.invoker.ApiClient;
+import org.oransc.ric.xappmgr.client.model.AllXapps;
+import org.oransc.ric.xappmgr.client.model.Xapp;
 import org.springframework.web.client.RestClientException;
 
 /**
  * Demonstrates use of the generated xApp manager client.
  * 
  * The test fails because no server is available.
+ * 
+ * The ugly name "DefaultApi" is generated because the spec lacks appropriate
+ * tags on the operation, also see
+ * https://stackoverflow.com/questions/38293236/swagger-swagger-codegen-maven-plugin-generate-default-api-interface
  */
 public class XappManagerClientTest {