Add error handling to improve user experience
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / AcXappController.java
index 3782656..46a4aab 100644 (file)
@@ -43,8 +43,10 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 
 /**
- * Provides methods to manage policies of the Admission Control xApp, which
- * initially defines just one. All requests go via the A1 Mediator.
+ * * Proxies calls from the front end to the AC xApp via the A1 Mediator API.
+ * All methods answer 502 on failure: <blockquote>HTTP server received an
+ * invalid response from a server it consulted when acting as a proxy or
+ * gateway.</blockquote>
  */
 @RestController
 @RequestMapping(value = DashboardConstants.ENDPOINT_PREFIX + "/xapp/ac", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -62,6 +64,8 @@ public class AcXappController {
        public AcXappController(final A1MediatorApi a1MediatorApi) {
                Assert.notNull(a1MediatorApi, "API must not be null");
                this.a1MediatorApi = a1MediatorApi;
+               if (logger.isDebugEnabled())
+                       logger.debug("ctor: configured with client type {}", a1MediatorApi.getClass().getName());
        }
 
        @ApiOperation(value = "Gets the A1 client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)