Add error handling to improve user experience
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / AnrXappController.java
index 7f14cde..2449caa 100644 (file)
@@ -70,17 +70,19 @@ public class AnrXappController {
        private final NcrtApi ncrtApi;
 
        @Autowired
-       public AnrXappController(final HealthApi healthApi, final NcrtApi ncrtApi) {
-               Assert.notNull(healthApi, "API must not be null");
-               Assert.notNull(ncrtApi, "API must not be null");
-               this.healthApi = healthApi;
-               this.ncrtApi = ncrtApi;
+       public AnrXappController(final HealthApi anrHealthApi, final NcrtApi anrNcrtApi) {
+               Assert.notNull(anrHealthApi, "API must not be null");
+               Assert.notNull(anrNcrtApi, "API must not be null");
+               this.healthApi = anrHealthApi;
+               this.ncrtApi = anrNcrtApi;
+               if (logger.isDebugEnabled())
+                       logger.debug("ctor: configured with client types {} and {}", anrHealthApi.getClass().getName(),
+                                       anrNcrtApi.getClass().getName());
        }
 
        @ApiOperation(value = "Gets the ANR client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
        @RequestMapping(value = DashboardConstants.VERSION_PATH, method = RequestMethod.GET)
-       public SuccessTransport getVersion() {
-               logger.debug("getVersion enter");
+       public SuccessTransport getAnrXappClientVersion() {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
        }
 
@@ -103,16 +105,17 @@ public class AnrXappController {
        @ApiOperation(value = "Returns list of gNodeB IDs based on NCRT in ANR", response = GgNodeBTable.class)
        @RequestMapping(value = "/gnodebs", method = RequestMethod.GET)
        public GgNodeBTable getGnodebs() {
+               logger.debug("getGnodebs");
                return ncrtApi.getgNodeB();
        }
 
        @ApiOperation(value = "Returns neighbor cell relation table for all gNodeBs or based on query parameters", response = NeighborCellRelationTable.class)
        @RequestMapping(value = "/ncrt", method = RequestMethod.GET)
-       public NeighborCellRelationTable getNcrtInfo( //
+       public NeighborCellRelationTable getNcrt( //
                        @RequestParam(name = QP_NODEB, required = false) String ggnbId, //
                        @RequestParam(name = QP_SERVING, required = false) String servingCellNrcgi, //
                        @RequestParam(name = QP_NEIGHBOR, required = false) String neighborCellNrpci) {
-               logger.debug("getNcrtInfo: ggnbid {}, servingCellNrpci {} neighborCellNrcgi {}", ggnbId, servingCellNrcgi,
+               logger.debug("getNcrt: ggnbid {}, servingCellNrpci {}, neighborCellNrcgi {}", ggnbId, servingCellNrcgi,
                                neighborCellNrpci);
                return ncrtApi.getNcrt(ggnbId, servingCellNrcgi, neighborCellNrpci);
        }