private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api";
private static final String REGISTER_ACTION = MACHINE_LEARNING_SERVICE_CTX + "/" + "registerAction";
private static final String CONSUL_ML_SERVICE_ID = "machine-learning";
- private static final String SERVICE_PROTOCOL = "http";
private static final String APP_KEY = "uebkey";
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
+ private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
+
@Autowired
AuditService auditService;
@Autowired
AppsCacheService appCacheService;
- private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
-
- private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
-
SuccessCallback<ResponseEntity<String>> successCallback = new SuccessCallback<ResponseEntity<String>>() {
@Override
public void onSuccess(ResponseEntity<String> arg) {
MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
logger.info(EELFLoggerDelegate.auditLogger,
- EPLogUtil.formatStoreAnalyticsAuditLogMessage(analyticsMap.getUserId(), appName,
+ EPLogUtil.formatStoreAnalyticsAuditLogMessage(analyticsMap.getUserid(), appName,
"WebAnalyticsExtAppController.postWebAnalyticsData",
EcompAuditLog.CD_ACTIVITY_STORE_ANALYTICS, analyticsMap.getAction(), analyticsMap.getPage(),
analyticsMap.getFunction(), analyticsMap.getType()));
protected void storeAuxAnalytics(Analytics analyticsMap, String appName) {
logger.info(EELFLoggerDelegate.debugLogger,
" Registering an action for recommendation: AppName/Function/UserId " + appName + "/"
- + analyticsMap.getFunction() + "/" + analyticsMap.getUserId());
+ + analyticsMap.getFunction() + "/" + analyticsMap.getUserid());
Map<String, String> requestMapping = new HashMap<String, String>();
- requestMapping.put("id", analyticsMap.getUserId());
+ requestMapping.put("id", analyticsMap.getUserid());
requestMapping.put("action", appName + "|" + analyticsMap.getFunction());
HttpHeaders headers = new HttpHeaders();
// send it!
ListenableFuture<ResponseEntity<String>> out = restTemplate.exchange(
- SERVICE_PROTOCOL + "://"
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID,
SystemProperties.getProperty("microservices.m-learn.local.port"))
+ REGISTER_ACTION,