X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FAnrXappController.java;h=3d32415a56b0d0ab79266a14f16bbc542013e609;hb=a1a3e0d2f8732570ad9688a842a86f513b40005b;hp=a05c25e809aa9c5f0276ff166264dae3c1d53c04;hpb=09df6d1bb8687f6f7970efbcac9bd3dc7b9503bb;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 a05c25e8..3d32415a 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 @@ -2,7 +2,7 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * Copyright (C) 2019 AT&T Intellectual Property * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,13 @@ import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.ApiOperation; /** - * Provides methods to contact the ANR xApp which manages a Neighbor Cell - * Relation Table (NCRT). + * Proxies calls from the front end to the ANR xApp, which manages a Neighbor + * Cell Relation Table (NCRT). + * + * If a method throws RestClientResponseException, it is handled by + * {@link CustomResponseEntityExceptionHandler#handleProxyMethodException(Exception, org.springframework.web.context.request.WebRequest)} + * which returns status 502. All other exceptions are handled by Spring which + * returns status 500. */ @Configuration @RestController @@ -143,7 +148,7 @@ public class AnrXappController { logger.debug("modifyNcrt: servingCellNrcgi {}, neighborCellNrpci {}, ncrMod {}", servingCellNrcgi, neighborCellNrpci, ncrMod); ncrtApi.modifyNcrt(servingCellNrcgi, neighborCellNrpci, ncrMod); - response.setStatus(healthApi.getApiClient().getStatusCode().value()); + response.setStatus(ncrtApi.getApiClient().getStatusCode().value()); } @ApiOperation(value = "Delete neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI") @@ -154,7 +159,7 @@ public class AnrXappController { HttpServletResponse response) { logger.debug("deleteNcrt: servingCellNrcgi {}, neighborCellNrpci {}", servingCellNrcgi, neighborCellNrpci); ncrtApi.deleteNcrt(servingCellNrcgi, neighborCellNrpci); - response.setStatus(healthApi.getApiClient().getStatusCode().value()); + response.setStatus(ncrtApi.getApiClient().getStatusCode().value()); } }