X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fcontroller%2FWebAnalyticsExtAppController.java;h=a3f4d301a435f5917b400ef786b88f93bf1483f6;hb=a3a04c5887779e9ca8024a3e87ece109b8d9b0c1;hp=f1192f92b6e32090569b8e6fecd01c0fa2ce2f0e;hpb=a2c93d258e4c564880601470434a7c0e168785c8;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java index f1192f92..a3f4d301 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java @@ -55,7 +55,7 @@ import org.onap.portalapp.portal.logging.aop.EPAuditLog; import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice; import org.onap.portalapp.portal.logging.logic.EPLogUtil; import org.onap.portalapp.portal.service.AppsCacheService; -import org.onap.portalapp.portal.service.ConsulHealthService; +import org.onap.portalapp.portal.service.WidgetMService; import org.onap.portalapp.portal.transport.Analytics; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EcompPortalUtils; @@ -89,7 +89,7 @@ import org.springframework.web.client.AsyncRestTemplate; @EPAuditLog @NoArgsConstructor public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseController { - private ConsulHealthService consulHealthService; + private WidgetMService widgetMService; private AppsCacheService appCacheService; private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api"; @@ -102,9 +102,9 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl private final FailureCallback failureCallback = arg -> logger.error(EELFLoggerDelegate.errorLogger, "storeAuxAnalytics failed", arg); @Autowired - public WebAnalyticsExtAppController(AppsCacheService appCacheService, ConsulHealthService consulHealthService) { + public WebAnalyticsExtAppController(AppsCacheService appCacheService, WidgetMService consulHealthService) { this.appCacheService = appCacheService; - this.consulHealthService = consulHealthService; + this.widgetMService = consulHealthService; } /** @@ -129,8 +129,8 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl } if (app != null) { String restEndPoint = app.getAppRestEndpoint(); - if(restEndPoint.contains("/api")) { - version = restEndPoint.substring(restEndPoint.indexOf("/api")+4); + if(restEndPoint.indexOf("/api")!=-1) { + version = restEndPoint.substring(restEndPoint.indexOf("api")); } } String endPoint = "/storeAnalytics"; @@ -242,7 +242,7 @@ public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseControl // send it! ListenableFuture> out = restTemplate.exchange( EcompPortalUtils.widgetMsProtocol() + "://" - + consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID, + + widgetMService.getServiceLocation(CONSUL_ML_SERVICE_ID, SystemProperties.getProperty("microservices.m-learn.local.port")) + REGISTER_ACTION, HttpMethod.POST, entity, String.class);