Merge "Drop Nokia from file header copyright line, part 2"
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / AnrXappController.java
index a05c25e..3d32415 100644 (file)
@@ -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());
        }
 
 }