X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FAnrXappController.java;h=dae8ae25ef3a252c6bcfe941fae09e8c1612a62a;hb=52d66fff0881226fe6ae0b1a2cd6c2c2e2837af4;hp=ea52a3a56e86547030b7ad0f7f6b624874fe27a4;hpb=8cfd065c881e3004ad2596591176d36ae155b701;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java index ea52a3a5..dae8ae25 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java @@ -23,7 +23,6 @@ import java.lang.invoke.MethodHandles; import javax.servlet.http.HttpServletResponse; -import org.oransc.ric.anrxapp.client.api.GnodebsApi; import org.oransc.ric.anrxapp.client.api.HealthApi; import org.oransc.ric.anrxapp.client.api.NcrtApi; import org.oransc.ric.anrxapp.client.model.GgNodeBTable; @@ -68,38 +67,32 @@ public class AnrXappController { // Populated by the autowired constructor private final HealthApi healthApi; - private final GnodebsApi gnodebsApi; private final NcrtApi ncrtApi; @Autowired - public AnrXappController(final HealthApi healthApi, final GnodebsApi gnodebsApi, final NcrtApi ncrtApi) { + public AnrXappController(final HealthApi healthApi, final NcrtApi ncrtApi) { Assert.notNull(healthApi, "API must not be null"); - Assert.notNull(gnodebsApi, "API must not be null"); Assert.notNull(ncrtApi, "API must not be null"); this.healthApi = healthApi; - this.gnodebsApi = gnodebsApi; this.ncrtApi = ncrtApi; } @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)); } @ApiOperation(value = "Performs a liveness probe on the ANR xApp, result expressed as the response code.") @RequestMapping(value = "/health/alive", method = RequestMethod.GET) - public void getHealthAlive(HttpServletResponse response) { - logger.debug("getHealthAlive"); + public void getAnrXappHealthAlive(HttpServletResponse response) { healthApi.getHealthAlive(); response.setStatus(healthApi.getApiClient().getStatusCode().value()); } @ApiOperation(value = "Performs a readiness probe on the ANR xApp, result expressed as the response code.") @RequestMapping(value = "/health/ready", method = RequestMethod.GET) - public void getHealthReady(HttpServletResponse response) { - logger.debug("getHealthReady"); + public void getAnrXappHealthReady(HttpServletResponse response) { healthApi.getHealthReady(); response.setStatus(healthApi.getApiClient().getStatusCode().value()); } @@ -107,18 +100,18 @@ 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() { - return gnodebsApi.getgNodeB(); + 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.getNcrtInfo(ggnbId, servingCellNrcgi, neighborCellNrpci); + return ncrtApi.getNcrt(ggnbId, servingCellNrcgi, neighborCellNrpci); } // /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} : @@ -136,7 +129,7 @@ public class AnrXappController { @ApiOperation(value = "Delete neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI") @RequestMapping(value = "/ncrt/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR - + "}", method = RequestMethod.PUT) + + "}", method = RequestMethod.DELETE) public void deleteNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, // @PathVariable(PP_NEIGHBOR) String neighborCellNrpci, // HttpServletResponse response) {