Log configuration details to ease debugging 95/95/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Tue, 30 Apr 2019 19:49:49 +0000 (15:49 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Tue, 30 Apr 2019 19:59:01 +0000 (15:59 -0400)
Add rudimentary docs dir

Change-Id: Ie5b4b98c1b001d4969b485f3dbdcbff2c220d6f1
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
docs/index.rst [new file with mode: 0644]
docs/overview.rst [new file with mode: 0644]
docs/release-notes.rst [new file with mode: 0644]
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java
webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java
webapp-backend/src/main/resources/logback.xml

diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644 (file)
index 0000000..f3a7116
--- /dev/null
@@ -0,0 +1,33 @@
+.. ===============LICENSE_START=======================================================
+.. O-RAN SC CC-BY-4.0
+.. %%
+.. 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=========================================================
+
+.. RIC Dashboard documentation master
+
+=============
+RIC Dashboard
+=============
+
+
+.. toctree::
+   :maxdepth: 2
+   :caption: Contents:
+
+   overview.rst
+   release-notes.rst
+
+* :ref:`search`
diff --git a/docs/overview.rst b/docs/overview.rst
new file mode 100644 (file)
index 0000000..2102905
--- /dev/null
@@ -0,0 +1,25 @@
+.. ===============LICENSE_START=======================================================
+.. O-RAN SC CC-BY-4.0
+.. %%
+.. 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=========================================================
+
+======================
+RIC Dashboard Overview
+======================
+
+The O-RAN SC RIC Dashboard provides administrative and operator functions.
+The web app is built as a single-page app using an Angular front end and a
+Java Spring-Boot back end.
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
new file mode 100644 (file)
index 0000000..05e1c23
--- /dev/null
@@ -0,0 +1,25 @@
+.. ===============LICENSE_START=======================================================
+.. O-RAN SC CC-BY-4.0
+.. %%
+.. 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=========================================================
+
+===========================
+RIC Dashboard Release Notes
+===========================
+
+Version 1.0.0, 30 Apr 2019
+--------------------------
+* Initial version
index 78d02c4..6498ee1 100644 (file)
  */
 package org.oranosc.ric.portal.dash.config;
 
+import java.lang.invoke.MethodHandles;
+
 import org.oranosc.ric.e2mgr.client.api.DefaultApi;
 import org.oranosc.ric.e2mgr.client.invoker.ApiClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
 import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
@@ -32,14 +37,18 @@ import org.springframework.web.client.RestTemplate;
  * Creates an E2 manager client as a bean to be managed by the Spring container.
  */
 @Configuration
+@Profile("!mock")
 public class E2ManagerConfiguration {
 
+       private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
        // Populated by the autowired constructor
        private final String e2mgrBasepath;
 
        @Autowired
        public E2ManagerConfiguration(@Value("${e2mgr.basepath}") final String e2mgrBasepath) {
                Assert.notNull(e2mgrBasepath, "base path must not be null");
+               logger.info("Configuring E2 Manager at base path {}", e2mgrBasepath);
                this.e2mgrBasepath = e2mgrBasepath;
        }
 
index e57992a..3ce923b 100644 (file)
@@ -24,12 +24,15 @@ import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
 import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 
@@ -41,8 +44,13 @@ import org.springframework.http.HttpStatus;
 @Configuration
 public class E2ManagerMockConfiguration {
 
+       private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+       public E2ManagerMockConfiguration() {
+               logger.info("Configuring mock E2 Manager");
+       }
+
        @Bean
-       @Primary
        public DefaultApi e2ManagerMockClient() {
                ApiClient mockClient = mock(ApiClient.class);
                when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
index 2818323..a980e16 100644 (file)
  */
 package org.oranosc.ric.portal.dash.config;
 
+import java.lang.invoke.MethodHandles;
+
 import org.oranosc.ric.xappmgr.client.api.DefaultApi;
 import org.oranosc.ric.xappmgr.client.invoker.ApiClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
 import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
@@ -33,14 +38,18 @@ import org.springframework.web.client.RestTemplate;
  * container.
  */
 @Configuration
+@Profile("!mock")
 public class XappManagerConfiguration {
 
+       private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
        // Populated by the autowired constructor
        private final String xappMgrBasepath;
 
        @Autowired
        public XappManagerConfiguration(@Value("${xappmgr.basepath}") final String xappMgrBasepath) {
                Assert.notNull(xappMgrBasepath, "base path must not be null");
+               logger.info("Configuring xApp Manager at base path {}", xappMgrBasepath);
                this.xappMgrBasepath = xappMgrBasepath;
        }
 
index 4829097..c1e1675 100644 (file)
@@ -24,6 +24,8 @@ import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 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;
@@ -32,9 +34,10 @@ 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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
 import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 
@@ -46,9 +49,12 @@ import org.springframework.http.HttpStatus;
 @Configuration
 public class XappManagerMockConfiguration {
 
+       private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
        private final AllXapps allXapps;
 
        public XappManagerMockConfiguration() {
+               logger.info("Configuring mock xApp Manager");
                allXapps = new AllXapps();
                allXapps.add(new Xapp().name("Pendulum Control").version("v1").status(StatusEnum.DEPLOYED));
                allXapps.add(new Xapp().name("Dual Connectivity").version("v2").status(StatusEnum.DELETED));
@@ -57,7 +63,6 @@ public class XappManagerMockConfiguration {
        }
 
        @Bean
-       @Primary
        public DefaultApi xappManagerMockClient() {
                ApiClient mockClient = mock(ApiClient.class);
                when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
index 67cfadf..ea46c19 100644 (file)
@@ -65,6 +65,8 @@ public class E2ManagerController {
        @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;
        }
 
index 094d518..9eb62e8 100644 (file)
@@ -61,6 +61,8 @@ public class XappManagerController {
        @Autowired
        public XappManagerController(final DefaultApi xappMgrClient) {
                Assert.notNull(xappMgrClient, "client must not be null");
+               if (logger.isDebugEnabled())
+                       logger.debug("ctor: configured with client type {}", xappMgrClient.getClass().getName());
                this.xappMgrClient = xappMgrClient;
        }
 
@@ -75,7 +77,8 @@ public class XappManagerController {
        @ApiOperation(value = "Calls the xApp Manager to get the list of xApps.", response = AllXapps.class)
        @RequestMapping(value = "/xapps", method = RequestMethod.GET)
        public AllXapps getAllXapps() {
-               logger.debug("getAllXapps via " + xappMgrClient.getApiClient().getBasePath());
+               if (logger.isDebugEnabled())
+                       logger.debug("getAllXapps via {}", xappMgrClient.getApiClient().getBasePath());
                return xappMgrClient.getAllXapps();
        }
 
index 8291117..4f213ae 100644 (file)
@@ -63,6 +63,6 @@
        </root>
 
        <!-- Code under test should be chatty --> >
-       <logger name="org.oranosc.ric.portal" level="DEBUG" />
+       <logger name="org.oranosc.ric.portal.dash" level="INFO" />
 
 </configuration>