*
* ============LICENSE_END============================================
*
- *
+ *
*/
package org.onap.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.onap.portalapp.portal.domain.BEProperty;
import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
import org.onap.portalsdk.core.controller.FusionBaseController;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.util.SystemProperties;
@RestController
@RequestMapping("/portalApi/properties")
public class BEPropertyReaderController extends FusionBaseController{
- @RequestMapping(value = "/readProperty", method = RequestMethod.GET, produces = "application/json")
+
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BEPropertyReaderController.class);
+
+ @GetMapping(value = "/readProperty", produces = "application/json")
public PortalRestResponse<BEProperty> readProperty(HttpServletRequest request, @RequestParam String key) {
try {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", new BEProperty(key, SystemProperties.getProperty(key)));
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "readProperty failed", e);
return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
- }
+ }
}
}