summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java14
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java28
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java9
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java3
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java24
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java10
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java3
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java10
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java14
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java4
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java38
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java5
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java283
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java48
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java12
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java16
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java6
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java222
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java12
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java4
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java6
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java2
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java39
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java289
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java4
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java1
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java46
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java20
38 files changed, 772 insertions, 416 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
index 6a6b3a65..99b4fcee 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java
@@ -667,7 +667,7 @@ public class AppsController extends EPRestrictedBaseController {
String appId = request.getParameter("appParam");
app = appService.getApp(Long.valueOf(appId));
if(!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
- app.setCentralAuth(false);
+ app.setRolesInAAF(false);
}
if (user != null && (adminRolesService.isAccountAdminOfApplication(user, app)
|| (adminRolesService.isSuperAdmin(user) && app.getId().equals(PortalConstants.PORTAL_APP_ID))))
@@ -721,7 +721,7 @@ public class AppsController extends EPRestrictedBaseController {
/**
*
* @param request
- * HTTP servlet request
+ * HTTP servlet request‰
* @param response
* HTTP servlet response
* @param modifiedOnboardingApp
@@ -734,7 +734,7 @@ public class AppsController extends EPRestrictedBaseController {
@RequestBody OnboardingApp modifiedOnboardingApp, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
EPUser user = null;
- EPApp oldEPApp = appService.getApp(modifiedOnboardingApp.id);
+ EPApp oldEPApp = appService.getApp(modifiedOnboardingApp.getId());
try {
user = EPUserUtils.getUserSession(request);
@@ -746,7 +746,7 @@ public class AppsController extends EPRestrictedBaseController {
response.getStatus());
return fieldsValidator;
} else {
- if((oldEPApp.getCentralAuth() && modifiedOnboardingApp.isCentralAuth && !oldEPApp.getNameSpace().equalsIgnoreCase(modifiedOnboardingApp.nameSpace) && modifiedOnboardingApp.nameSpace!= null ) || (!oldEPApp.getCentralAuth() && modifiedOnboardingApp.isCentralAuth && modifiedOnboardingApp.nameSpace!= null))
+ if((oldEPApp.getRolesInAAF() && modifiedOnboardingApp.getRolesInAAF() && !oldEPApp.getNameSpace().equalsIgnoreCase(modifiedOnboardingApp.getNameSpace()) && modifiedOnboardingApp.getNameSpace()!= null ) || (!oldEPApp.getRolesInAAF() && modifiedOnboardingApp.getRolesInAAF() && modifiedOnboardingApp.getNameSpace() != null))
{
checkIfNameSpaceIsValid(modifiedOnboardingApp, fieldsValidator, response);
}
@@ -795,7 +795,7 @@ public class AppsController extends EPRestrictedBaseController {
EcompPortalUtils.setBadPermissions(user, response, "postOnboardingApps");
} else {
newOnboardingApp.normalize();
- if(newOnboardingApp.isCentralAuth != null && newOnboardingApp.isCentralAuth)
+ if(newOnboardingApp.getRolesInAAF() != null && newOnboardingApp.getRolesInAAF())
checkIfNameSpaceIsValid(newOnboardingApp, fieldsValidator, response);
fieldsValidator = appService.addOnboardingApp(newOnboardingApp, user);
response.setStatus(fieldsValidator.httpStatusCode.intValue());
@@ -883,7 +883,7 @@ public class AppsController extends EPRestrictedBaseController {
* Application ID
* @return Bytes with the app thumbnail image; null if not available.
*/
- @RequestMapping(value = { "/portalApi/appThumbnail/{appId}" }, method = { RequestMethod.GET })
+ @GetMapping(value = { "/portalApi/appThumbnail/{appId}" })
public HttpEntity<byte[]> getAppThumbnail(HttpServletRequest request, @PathVariable("appId") Long appId,
HttpServletResponse response) {
EPApp app = appService.getApp(appId);
@@ -911,7 +911,7 @@ public class AppsController extends EPRestrictedBaseController {
private void checkIfNameSpaceIsValid(OnboardingApp modifiedOnboardingApp, FieldsValidator fieldsValidator, HttpServletResponse response)
throws InvalidApplicationException {
try {
- ResponseEntity<String> res = appService.checkIfNameSpaceIsValid(modifiedOnboardingApp.nameSpace);
+ ResponseEntity<String> res = appService.checkIfNameSpaceIsValid(modifiedOnboardingApp.getNameSpace());
} catch (HttpClientErrorException e) {
logger.error(EELFLoggerDelegate.errorLogger, "checkIfNameSpaceExists failed", e);
EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
index ce29900f..a88728a0 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java
@@ -208,7 +208,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
@PathVariable("appId") Long appId) {
EPApp epApp = appService.getApp(appId);
OnboardingApp obApp = new OnboardingApp();
- epApp.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD); //to hide password from get request
+ epApp.setAppBasicAuthPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD); //to hide password from get request
appService.createOnboardingFromApp(epApp, obApp);
EcompPortalUtils.logAndSerializeObject(logger, "getOnboardAppExternal", RESPONSE, obApp);
return obApp;
@@ -252,7 +252,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
return portalResponse;
}
// Validate fields
- if (newOnboardApp.id != null) {
+ if (newOnboardApp.getId() != null) {
portalResponse.setStatus(PortalRestStatusEnum.ERROR);
portalResponse.setMessage("Unexpected field: id");
return portalResponse;
@@ -266,10 +266,10 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
try {
List<EPUser> userList;
- userList = userService.getUserByUserId(newOnboardApp.myLoginsAppOwner);
+ userList = userService.getUserByUserId(newOnboardApp.getMyLoginsAppOwner());
if (userList == null || userList.size() != 1) {
portalResponse.setStatus(PortalRestStatusEnum.ERROR);
- portalResponse.setMessage("Failed to find user: " + newOnboardApp.myLoginsAppOwner);
+ portalResponse.setMessage("Failed to find user: " + newOnboardApp.getMyLoginsAppOwner());
return portalResponse;
}
@@ -343,7 +343,7 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
// Validate fields.
- if (appId == null || !appId.equals(oldOnboardApp.id)) {
+ if (appId == null || !appId.equals(oldOnboardApp.getId())) {
portalResponse.setStatus(PortalRestStatusEnum.ERROR);
portalResponse.setMessage("Unexpected value for field: id");
return portalResponse;
@@ -358,10 +358,10 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
try {
List<EPUser> userList;
- userList = userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner);
+ userList = userService.getUserByUserId(oldOnboardApp.getMyLoginsAppOwner());
if (userList == null || userList.size() != 1) {
portalResponse.setStatus(PortalRestStatusEnum.ERROR);
- portalResponse.setMessage("Failed to find user: " + oldOnboardApp.myLoginsAppOwner);
+ portalResponse.setMessage("Failed to find user: " + oldOnboardApp.getMyLoginsAppOwner());
return portalResponse;
}
@@ -398,15 +398,15 @@ public class AppsControllerExternalRequest implements BasicAuthenticationControl
}
private boolean checkIfFieldsAreNull(OnboardingApp onboardingApp) {
- return onboardingApp.name == null || onboardingApp.url == null || onboardingApp.restUrl == null
- || onboardingApp.myLoginsAppOwner == null || onboardingApp.restrictedApp == null
- || onboardingApp.isOpen == null || onboardingApp.isEnabled == null;
+ return onboardingApp.getAppName() == null || onboardingApp.getLandingPage() == null || onboardingApp.getRestUrl() == null
+ || onboardingApp.getMyLoginsAppOwner() == null || onboardingApp.getRestrictedApp() == null
+ || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null;
}
private boolean checkIfFieldsAreEmpty(OnboardingApp onboardingApp) {
- return onboardingApp.name.trim().isEmpty()
- || onboardingApp.url.trim().isEmpty()
- || onboardingApp.restUrl.trim().isEmpty()
- || onboardingApp.myLoginsAppOwner.trim().isEmpty();
+ return onboardingApp.getAppName().trim().isEmpty()
+ || onboardingApp.getLandingPage().trim().isEmpty()
+ || onboardingApp.getRestUrl().trim().isEmpty()
+ || onboardingApp.getMyLoginsAppOwner().trim().isEmpty();
}
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
index 2f4f7883..9acb8833 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuxApiRequestMapperController.java
@@ -88,7 +88,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java
index c57dc4f9..4f02f240 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java
@@ -60,7 +60,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java
index 83b5155d..67e71c50 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java
@@ -851,7 +851,7 @@ public class ExternalAccessRolesController implements BasicAuthenticationControl
if(app.isEmpty()){
throw new Exception(INVALID_UEB_KEY);
}
- if(!app.isEmpty() && app.get(0).getCentralAuth()){
+ if(!app.isEmpty() && app.get(0).getRolesInAAF()){
ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(app.get(0));
if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND)
throw new Exception("Invalid NameSpace");
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java
index 19441ac9..6124544e 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java
@@ -46,9 +46,7 @@ import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.onap.portalapp.controller.EPUnRestrictedBaseController;
import org.onap.portalapp.portal.domain.EPUser;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java
index d78d6146..0acfabfe 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java
@@ -47,9 +47,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.MDC;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.onap.music.main.MusicUtil;
import org.onap.portalapp.controller.EPUnRestrictedBaseController;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
index d371dd5c..0046bc59 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/LanguageController.java
@@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java
index 747b3da1..5e3212ec 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java
@@ -48,7 +48,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.onap.portalapp.portal.logging.aop.EPAuditLog;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java
index 6bb5b693..a80a3b42 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java
@@ -65,12 +65,10 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java
index 134d99ef..8bf93549 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java
@@ -53,9 +53,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
@@ -105,9 +103,16 @@ public class MicroserviceProxyController extends EPUnRestrictedBaseController {
*/
private boolean isValidJSON(String response) {
try {
+ if(response != null && !response.isEmpty())
+ {
final ObjectMapper mapper = new ObjectMapper();
mapper.readTree(response);
return true;
+ }
+ else
+ {
+ return false;
+ }
} catch (IOException e) {
logger.debug(EELFLoggerDelegate.debugLogger, "isValidJSON failed", e);
return false;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java
index 563a387a..0cc3e3fa 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java
@@ -70,12 +70,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
index e308182c..4b983d8d 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java
@@ -7,10 +7,10 @@
* Modifications Copyright (c) 2019 Samsung
* ===================================================================
* Modifications Copyright (c) 2020 IBM
- * ===================================================================
- *
+ * ===================================================================
+ *
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the "License");
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -97,10 +97,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -166,7 +164,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth()) {
+ if (requestedApp.getRolesInAAF()) {
List<CentralV2Role> answer = null;
Map<String, Object> model = new HashMap<>();
ObjectMapper mapper = new ObjectMapper();
@@ -244,7 +242,7 @@ public class RoleManageController extends EPRestrictedBaseController {
requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth()) {
+ if (requestedApp.getRolesInAAF()) {
externalRequestFieldsValidator = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
requestedApp.getUebKey(), user.getOrgUserId());
boolean deleteResponse = externalRequestFieldsValidator.isResult();
@@ -307,7 +305,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp != null && requestedApp.getCentralAuth().equals(true)) {
+ if (requestedApp != null && requestedApp.getRolesInAAF().equals(true)) {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
@@ -450,7 +448,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth()) {
+ if (requestedApp.getRolesInAAF()) {
CentralV2Role answer = externalAccessRolesService.getRoleInfo(roleId, requestedApp.getUebKey());
logger.info(EELFLoggerDelegate.applicationLogger, "role_id" + roleId);
Map<String, Object> model = new HashMap<>();
@@ -483,7 +481,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth()) {
+ if (requestedApp.getRolesInAAF()) {
List<CentralV2RoleFunction> answer = null;
Map<String, Object> model = new HashMap<>();
ObjectMapper mapper = new ObjectMapper();
@@ -525,7 +523,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth() && roleFunc!=null) {
+ if (requestedApp.getRolesInAAF() && roleFunc!=null) {
String code = roleFunc.getType() + PIPE + roleFunc.getCode() + PIPE + roleFunc.getAction();
CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(code,
requestedApp.getUebKey());
@@ -624,7 +622,7 @@ public class RoleManageController extends EPRestrictedBaseController {
EPApp requestedApp = appService.getApp(appId);
if (isAuthorizedUser(user, requestedApp)) {
fieldsValidation(requestedApp);
- if (requestedApp.getCentralAuth()) {
+ if (requestedApp.getRolesInAAF()) {
ObjectMapper mapper = new ObjectMapper();
String data = roleFunc;
boolean getDelFuncResponse = false;
@@ -811,7 +809,7 @@ public class RoleManageController extends EPRestrictedBaseController {
throw new InvalidApplicationException("Invalid credentials");
}
if (!appInfo.isEmpty() && EcompPortalUtils.checkIfRemoteCentralAccessAllowed()
- && appInfo.get(0).getCentralAuth()) {
+ && appInfo.get(0).getRolesInAAF()) {
ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(appInfo.get(0));
if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND)
throw new InvalidApplicationException("Invalid NameSpace");
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
index 487cc4d5..5b953b6e 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java
@@ -56,7 +56,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
@@ -81,7 +83,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl
* @return PortalRestResponse with appropriate status value and message
*/
@ApiOperation(value = "Creates an application user with the specified roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/userProfile" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/userProfile" }, produces = "application/json")
public PortalRestResponse<String> postUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
ExternalRequestFieldsValidator reqResult = null;
@@ -129,7 +131,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl
* @return PortalRestResponse with appropriate status value and message
*/
@ApiOperation(value = "Updates an application user to have only the specified roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/userProfile" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/userProfile" }, produces = "application/json")
public PortalRestResponse<String> putUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
ExternalRequestFieldsValidator reqResult = null;
@@ -176,7 +178,7 @@ public class RolesApprovalSystemController implements BasicAuthenticationControl
* @return PortalRestResponse with appropriate status value and message
*/
@ApiOperation(value = "Processes a request to delete one or more application roles for one specified user who has roles.", response = PortalRestResponse.class)
- @RequestMapping(value = { "/userProfile" }, method = RequestMethod.DELETE, produces = "application/json")
+ @DeleteMapping(value = { "/userProfile" }, produces = "application/json")
public PortalRestResponse<String> deleteUserProfile(HttpServletRequest request,
@RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
ExternalRequestFieldsValidator reqResult = null;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
index 85c48b7b..20fddf91 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java
@@ -58,6 +58,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@@ -75,7 +76,7 @@ public class SchedulerAuxController extends EPRestrictedBaseController {
/** The logger. */
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxController.class);
- @RequestMapping(value = "/get_policy", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/get_policy", produces = "application/json")
public ResponseEntity<String> getPolicyInfo(HttpServletRequest request) throws Exception {
try {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java
index 69f25683..53275763 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java
@@ -77,6 +77,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@@ -102,7 +104,7 @@ public class SchedulerController extends EPRestrictedBaseController {
this.adminRolesService = adminRolesService;
}
- @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/get_time_slots/{scheduler_request}", produces = "application/json")
public ResponseEntity<String> getTimeSlots(HttpServletRequest request,
@PathVariable("scheduler_request") String schedulerRequest) throws Exception {
if (checkIfUserISValidToMakeSchedule(request)) {
@@ -169,7 +171,7 @@ public class SchedulerController extends EPRestrictedBaseController {
}
@SuppressWarnings("unchecked")
- @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/post_create_new_vnf_change", produces = "application/json")
public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request,
@RequestBody JSONObject schedulerRequest) throws Exception {
if (checkIfUserISValidToMakeSchedule(request)) {
@@ -249,7 +251,7 @@ public class SchedulerController extends EPRestrictedBaseController {
}
}
- @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/submit_vnf_change_timeslots", produces = "application/json")
public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request,
@RequestBody JSONObject schedulerRequest) throws Exception {
if (checkIfUserISValidToMakeSchedule(request)) {
@@ -335,7 +337,7 @@ public class SchedulerController extends EPRestrictedBaseController {
* @return Rest response wrapped around a String; e.g., "success" or "ERROR"
* @throws Exception
*/
- @RequestMapping(value = "/get_scheduler_constant", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/get_scheduler_constant", produces = "application/json")
public PortalRestResponse<Map<String, String>> getSchedulerConstant(HttpServletRequest request,
HttpServletResponse response) throws Exception {
logger.debug(EELFLoggerDelegate.debugLogger, "get scheduler constant");
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java
index 9e3428e6..232b691f 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java
@@ -63,6 +63,8 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -114,7 +116,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Gets a value for the specified context and key.", response = SharedContext.class)
- @RequestMapping(value = { "/get" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/get" }, produces = "application/json")
public String getContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
throws Exception {
logger.debug(EELFLoggerDelegate.debugLogger, "getContext for ID " + context_id + ", key " + ckey);
@@ -151,7 +153,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Gets user information for the specified context.", response = SharedContext.class, responseContainer = "List")
- @RequestMapping(value = { "/get_user" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/get_user" }, produces = "application/json")
public String getUserContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
logger.debug(EELFLoggerDelegate.debugLogger, "getUserContext for ID " + context_id);
@@ -197,7 +199,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Tests for presence of the specified key in the specified context.", response = SharedContextJsonResponse.class)
- @RequestMapping(value = { "/check" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/check" }, produces = "application/json")
public String checkContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
throws Exception {
@@ -236,7 +238,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Removes the specified key in the specified context.", response = SharedContextJsonResponse.class)
- @RequestMapping(value = { "/remove" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/remove" }, produces = "application/json")
public String removeContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
throws Exception {
@@ -275,7 +277,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Clears all key-value pairs in the specified context.", response = SharedContextJsonResponse.class)
- @RequestMapping(value = { "/clear" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/clear" }, produces = "application/json")
public String clearContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
logger.debug(EELFLoggerDelegate.debugLogger, "clearContext for " + context_id);
@@ -311,7 +313,7 @@ public class SharedContextRestController extends EPRestrictedRESTfulBaseControll
* on bad arguments
*/
@ApiOperation(value = "Sets a context value for the specified context and key. Creates the context if no context with the specified ID-key pair exists, overwrites the value if it exists already.", response = SharedContextJsonResponse.class)
- @RequestMapping(value = { "/set" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/set" }, produces = "application/json")
public String setContext(HttpServletRequest request, @RequestBody String userJson) throws Exception {
if (userJson !=null){
SecureString secureUserJson = new SecureString(userJson);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java
index eab811ab..9ba56224 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetMSController.java
@@ -48,7 +48,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
@RestController
@@ -60,7 +60,7 @@ public class WidgetMSController extends EPRestrictedBaseController {
private WidgetMService widgetMService;
// Get location of a healthy node running our service
- @RequestMapping(value = { "/service/{service}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/service/{service}" }, produces = "application/json")
public PortalRestResponse<String> getServiceLocation(HttpServletRequest request, HttpServletResponse response,
@PathVariable("service") String service) {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
index a4037375..4b68a01e 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java
@@ -80,8 +80,10 @@ import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
-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.PutMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
@@ -135,7 +137,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
});
}
- @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" })
public List<WidgetCatalog> getUserWidgetCatalog(@PathVariable("loginName") String loginName) {
List<WidgetCatalog> widgets = new ArrayList<>();
try {
@@ -155,7 +157,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return widgets;
}
- @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/widgetCatalog" })
public List<WidgetCatalog> getWidgetCatalog() {
List<WidgetCatalog> widgets = new ArrayList<>();
try {
@@ -175,8 +177,8 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return widgets;
}
- @RequestMapping(value = {
- "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = {
+ "/portalApi/microservices/widgetCatalog/{widgetId}" }, produces = "application/json")
public void updateWidgetCatalog(@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId) throws Exception {
template.exchange(
EcompPortalUtils.widgetMsProtocol() + "://"
@@ -186,7 +188,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
HttpMethod.PUT, new HttpEntity<>(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
}
- @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.DELETE)
+ @DeleteMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" })
public void deleteOnboardingWidget(@PathVariable("widgetId") long widgetId) throws Exception {
template.exchange(
EcompPortalUtils.widgetMsProtocol() + "://"
@@ -196,7 +198,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
HttpMethod.DELETE, new HttpEntity<>(WidgetServiceHeaders.getInstance()), String.class);
}
- @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" })
public String updateWidgetCatalogWithFiles(HttpServletRequest request,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
MultipartHttpServletRequest mRequest;
@@ -230,7 +232,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return respond;
}
- @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/microservices/widgetCatalog" })
public String createWidgetCatalog(HttpServletRequest request)
throws Exception {
@@ -272,7 +274,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return respond;
}
- @RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
+ @GetMapping(value = "/portalApi/microservices/{widgetId}/framework.js")
public String getWidgetFramework(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ widgetMService.getServiceLocation(whatService,
@@ -281,7 +283,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
WidgetServiceHeaders.getInstance());
}
- @RequestMapping(value = "/portalApi/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
+ @GetMapping(value = "/portalApi/microservices/{widgetId}/controller.js")
public String getWidgetController(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ widgetMService.getServiceLocation(whatService,
@@ -290,7 +292,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
WidgetServiceHeaders.getInstance());
}
- @RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
+ @GetMapping(value = "/portalApi/microservices/{widgetId}/style.css")
public String getWidgetCSS(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ widgetMService.getServiceLocation(whatService,
@@ -299,7 +301,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
WidgetServiceHeaders.getInstance());
}
- @RequestMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/parameters/{widgetId}" })
public PortalRestResponse<List<WidgetParameterResult>> getWidgetParameterResult(HttpServletRequest request,
@PathVariable("widgetId") long widgetId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
@@ -335,17 +337,17 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", list);
}
- @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/services/{paramId}" })
public List<WidgetCatalogParameter> getUserParameterById( @PathVariable("paramId") long paramId) {
return widgetParameterService.getUserParameterById(paramId);
}
- @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.DELETE)
+ @DeleteMapping(value = { "/portalApi/microservices/services/{paramId}" })
public void deleteUserParameterById(@PathVariable("paramId") long paramId) {
widgetParameterService.deleteUserParameterById(paramId);
}
- @RequestMapping(value = { "/portalApi/microservices/download/{widgetId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/download/{widgetId}" })
public void doDownload(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws Exception {
@@ -394,7 +396,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
}
}
- @RequestMapping(value = { "/portalApi/microservices/parameters" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/microservices/parameters" })
public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request,
@RequestBody WidgetCatalogParameter widgetParameters) {
EPUser user = EPUserUtils.getUserSession(request);
@@ -414,7 +416,7 @@ public class WidgetsCatalogController extends EPRestrictedBaseController {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
- @RequestMapping(value = { "/portalApi/microservices/uploadFlag" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices/uploadFlag" })
public String getUploadFlag() {
String uplaodFlag="";
try {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java
index 0c464fbf..eba0faf4 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java
@@ -51,8 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
-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.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
@@ -89,7 +88,7 @@ public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController
});
}
- @RequestMapping(value = "/portalApi/microservices/markup/{widgetId}", method = RequestMethod.GET)
+ @GetMapping(value = "/portalApi/microservices/markup/{widgetId}")
public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
return template
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
index 56f50406..306a0efb 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java
@@ -64,12 +64,10 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java
index 8227d9ab..61fcfaee 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java
@@ -52,45 +52,72 @@ import org.onap.portalsdk.core.domain.support.DomainVo;
public class EPApp extends DomainVo {
private static final long serialVersionUID = 1L;
+
@SafeHtml
private String name;
+
@SafeHtml
private String imageUrl;
+
@SafeHtml
- private String description;
+ private String appDescription;
+
@SafeHtml
- private String notes;
+ private String appNotes;
+
@SafeHtml
- private String url;
+ private String landingPage;
+
@SafeHtml
- private String alternateUrl;
+ private String alternateLandingPage;
+
@SafeHtml
private String appRestEndpoint;
+
@SafeHtml
private String mlAppName;
+
@SafeHtml
private String mlAppAdminId;
private Long motsId;
+
@SafeHtml
- private String username;
+ private String appBasicAuthUsername;
+
@SafeHtml
- private String appPassword;
+ private String appBasicAuthPassword;
+
@Lob
private byte[] thumbnail;
+
private Boolean open;
+
private Boolean enabled;
+
@SafeHtml
private String uebTopicName;
+
@SafeHtml
private String uebKey;
+
@SafeHtml
private String uebSecret;
+
private Integer appType;
+
@Valid
private AppContactUs contactUs;
- private Boolean centralAuth;
+
+ private Boolean rolesInAAF;
@SafeHtml
- private String nameSpace;
+ private String nameSpace;
+
+ @SafeHtml
+ private String modeOfIntegration;
+
+ private Boolean appAck;
+
+ private Boolean usesCadi;
public EPApp() {
// Attention!!!
@@ -102,8 +129,8 @@ public class EPApp extends DomainVo {
this.name = "";
this.mlAppName = "";
this.mlAppAdminId = "";
- this.username = "";
- this.appPassword = "";
+ this.appBasicAuthUsername = "";
+ this.appBasicAuthPassword = "";
this.open = new Boolean(false);
this.enabled = new Boolean(true);
this.uebTopicName = "";
@@ -131,8 +158,6 @@ public class EPApp extends DomainVo {
this.imageUrl = imageUrl;
}
-
-
public byte[] getThumbnail() {
return this.thumbnail;
}
@@ -141,36 +166,36 @@ public class EPApp extends DomainVo {
this.thumbnail = thumbnail;
}
- public String getDescription() {
- return description;
+ public String getAppDescription() {
+ return appDescription;
}
- public void setDescription(String description) {
- this.description = description;
+ public void setAppDescription(String appDescription) {
+ this.appDescription = appDescription;
}
- public String getNotes() {
- return notes;
+ public String getAppNotes() {
+ return appNotes;
}
- public void setNotes(String notes) {
- this.notes = notes;
+ public void setAppNotes(String appNotes) {
+ this.appNotes = appNotes;
}
- public String getUrl() {
- return url;
+ public String getLandingPage() {
+ return landingPage;
}
- public void setUrl(String url) {
- this.url = url;
+ public void setLandingPage(String landingPage) {
+ this.landingPage = landingPage;
}
- public String getAlternateUrl() {
- return alternateUrl;
+ public String getAlternateLandingPage() {
+ return alternateLandingPage;
}
- public void setAlternateUrl(String alternateUrl) {
- this.alternateUrl = alternateUrl;
+ public void setAlternateLandingPage(String alternateLandingPage) {
+ this.alternateLandingPage = alternateLandingPage;
}
public String getAppRestEndpoint() {
@@ -211,25 +236,25 @@ public class EPApp extends DomainVo {
this.motsId = motsId;
}
- public String getUsername() {
- return username;
+ public String getAppBasicAuthUsername() {
+ return appBasicAuthUsername;
}
- public void setUsername(String username) {
- this.username = username;
+ public void setAppBasicAuthUsername(String appBasicAuthUsername) {
+ this.appBasicAuthUsername = appBasicAuthUsername;
}
- public String getAppPassword() {
- return appPassword;
+ public String getAppBasicAuthPassword() {
+ return appBasicAuthPassword;
}
- public void setAppPassword(String appPassword) {
- if (StringUtils.isEmpty(appPassword)) {
- appPassword = "";
+ public void setAppBasicAuthPassword(String appBasicAuthPassword) {
+ if (StringUtils.isEmpty(appBasicAuthPassword)) {
+ appBasicAuthPassword = "";
}
- this.appPassword = appPassword;
+ this.appBasicAuthPassword = appBasicAuthPassword;
}
-
+
public Boolean getOpen() {
return open;
}
@@ -252,25 +277,6 @@ public class EPApp extends DomainVo {
this.enabled = enabled;
}
- public Integer getAppType() {
- return appType;
- }
-
- public void setAppType(Integer appType) {
- if (appType == null) {
- appType = new Integer(1);
- }
- this.appType = appType;
- }
-
- public void setRestrictedApp(Boolean restrictedApp) {
- Integer result = 1;
- if (restrictedApp) {
- result = 2;
- }
- this.appType = result;
- }
-
public Boolean isRestrictedApp() {
return (this.appType == 2 ? true : false);
}
@@ -308,6 +314,14 @@ public class EPApp extends DomainVo {
return this.uebSecret;
}
+ public Integer getAppType() {
+ return appType;
+ }
+
+ public void setAppType(Integer appType) {
+ this.appType = appType;
+ }
+
public void setUebSecret(String uebSecret) {
if (StringUtils.isEmpty(uebSecret)) {
this.uebSecret = "";
@@ -322,18 +336,18 @@ public class EPApp extends DomainVo {
public void setContactUs(AppContactUs contactUs) {
this.contactUs = contactUs;
}
-
- public Boolean getCentralAuth() {
- return centralAuth;
+
+ public Boolean getRolesInAAF() {
+ return rolesInAAF;
}
- public void setCentralAuth(Boolean centralAuth) {
- if (centralAuth == null) {
- centralAuth = new Boolean(false);
+ public void setRolesInAAF(Boolean rolesInAAF) {
+ if (rolesInAAF == null) {
+ rolesInAAF = new Boolean(false);
}
- this.centralAuth = centralAuth;
+ this.rolesInAAF = rolesInAAF;
}
-
+
public String getNameSpace() {
return nameSpace;
}
@@ -345,38 +359,71 @@ public class EPApp extends DomainVo {
this.nameSpace = nameSpace;
}
+ public String getModeOfIntegration() {
+ return modeOfIntegration;
+ }
+
+ public void setModeOfIntegration(String modeOfIntegration) {
+ this.modeOfIntegration = modeOfIntegration;
+ }
+
+ public Boolean getAppAck() {
+ return appAck;
+ }
+
+ public void setAppAck(Boolean appAck) {
+ this.appAck = appAck;
+ }
+
+ public Boolean getUsesCadi() {
+ return usesCadi;
+ }
+
+ public void setUsesCadi(Boolean usesCadi) {
+ this.usesCadi = usesCadi;
+ }
+
@Override
public String toString() {
- String str = "[" + getId() + ":" + getName() + "]";
- return str;
+ return "EPApp [name=" + name + ", imageUrl=" + imageUrl + ", appDescription=" + appDescription + ", appNotes="
+ + appNotes + ", landingPage=" + landingPage + ", alternateLandingPage=" + alternateLandingPage
+ + ", appRestEndpoint=" + appRestEndpoint + ", mlAppName=" + mlAppName + ", mlAppAdminId=" + mlAppAdminId
+ + ", motsId=" + motsId + ", appBasicAuthUsername=" + appBasicAuthUsername + ", appBasicAuthPassword="
+ + appBasicAuthPassword + ", thumbnail=" + Arrays.toString(thumbnail) + ", open=" + open + ", enabled="
+ + enabled + ", uebTopicName=" + uebTopicName + ", uebKey=" + uebKey + ", uebSecret=" + uebSecret
+ + ", appType=" + appType + ", contactUs=" + contactUs + ", rolesInAAF=" + rolesInAAF + ", nameSpace="
+ + nameSpace + ", modeOfIntegration=" + modeOfIntegration + ", appAck=" + appAck + ", usesCadi="
+ + usesCadi + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());
- result = prime * result + ((appPassword == null) ? 0 : appPassword.hashCode());
+ result = prime * result + ((alternateLandingPage == null) ? 0 : alternateLandingPage.hashCode());
+ result = prime * result + ((appAck == null) ? 0 : appAck.hashCode());
+ result = prime * result + ((appBasicAuthPassword == null) ? 0 : appBasicAuthPassword.hashCode());
+ result = prime * result + ((appBasicAuthUsername == null) ? 0 : appBasicAuthUsername.hashCode());
+ result = prime * result + ((appDescription == null) ? 0 : appDescription.hashCode());
+ result = prime * result + ((appNotes == null) ? 0 : appNotes.hashCode());
result = prime * result + ((appRestEndpoint == null) ? 0 : appRestEndpoint.hashCode());
result = prime * result + ((appType == null) ? 0 : appType.hashCode());
- result = prime * result + ((centralAuth == null) ? 0 : centralAuth.hashCode());
- result = prime * result + ((contactUs == null) ? 0 : contactUs.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((enabled == null) ? 0 : enabled.hashCode());
result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
+ result = prime * result + ((landingPage == null) ? 0 : landingPage.hashCode());
result = prime * result + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
result = prime * result + ((mlAppName == null) ? 0 : mlAppName.hashCode());
+ result = prime * result + ((modeOfIntegration == null) ? 0 : modeOfIntegration.hashCode());
result = prime * result + ((motsId == null) ? 0 : motsId.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((nameSpace == null) ? 0 : nameSpace.hashCode());
- result = prime * result + ((notes == null) ? 0 : notes.hashCode());
result = prime * result + ((open == null) ? 0 : open.hashCode());
+ result = prime * result + ((rolesInAAF == null) ? 0 : rolesInAAF.hashCode());
result = prime * result + Arrays.hashCode(thumbnail);
result = prime * result + ((uebKey == null) ? 0 : uebKey.hashCode());
result = prime * result + ((uebSecret == null) ? 0 : uebSecret.hashCode());
result = prime * result + ((uebTopicName == null) ? 0 : uebTopicName.hashCode());
- result = prime * result + ((url == null) ? 0 : url.hashCode());
- result = prime * result + ((username == null) ? 0 : username.hashCode());
+ result = prime * result + ((usesCadi == null) ? 0 : usesCadi.hashCode());
return result;
}
@@ -384,45 +431,50 @@ public class EPApp extends DomainVo {
public boolean equals(Object obj) {
if (this == obj)
return true;
- if (obj == null)
+ if (!super.equals(obj))
return false;
- if (getClass() != obj.getClass())
+ if (!(obj instanceof EPApp))
return false;
EPApp other = (EPApp) obj;
- if (alternateUrl == null) {
- if (other.alternateUrl != null)
+ if (alternateLandingPage == null) {
+ if (other.alternateLandingPage != null)
return false;
- } else if (!alternateUrl.equals(other.alternateUrl))
+ } else if (!alternateLandingPage.equals(other.alternateLandingPage))
return false;
- if (appPassword == null) {
- if (other.appPassword != null)
+ if (appAck == null) {
+ if (other.appAck != null)
return false;
- } else if (!appPassword.equals(other.appPassword))
+ } else if (!appAck.equals(other.appAck))
return false;
- if (appRestEndpoint == null) {
- if (other.appRestEndpoint != null)
+ if (appBasicAuthPassword == null) {
+ if (other.appBasicAuthPassword != null)
return false;
- } else if (!appRestEndpoint.equals(other.appRestEndpoint))
+ } else if (!appBasicAuthPassword.equals(other.appBasicAuthPassword))
return false;
- if (appType == null) {
- if (other.appType != null)
+ if (appBasicAuthUsername == null) {
+ if (other.appBasicAuthUsername != null)
return false;
- } else if (!appType.equals(other.appType))
+ } else if (!appBasicAuthUsername.equals(other.appBasicAuthUsername))
return false;
- if (centralAuth == null) {
- if (other.centralAuth != null)
+ if (appDescription == null) {
+ if (other.appDescription != null)
return false;
- } else if (!centralAuth.equals(other.centralAuth))
+ } else if (!appDescription.equals(other.appDescription))
return false;
- if (contactUs == null) {
- if (other.contactUs != null)
+ if (appNotes == null) {
+ if (other.appNotes != null)
return false;
- } else if (!contactUs.equals(other.contactUs))
+ } else if (!appNotes.equals(other.appNotes))
return false;
- if (description == null) {
- if (other.description != null)
+ if (appRestEndpoint == null) {
+ if (other.appRestEndpoint != null)
return false;
- } else if (!description.equals(other.description))
+ } else if (!appRestEndpoint.equals(other.appRestEndpoint))
+ return false;
+ if (appType == null) {
+ if (other.appType != null)
+ return false;
+ } else if (!appType.equals(other.appType))
return false;
if (enabled == null) {
if (other.enabled != null)
@@ -434,6 +486,11 @@ public class EPApp extends DomainVo {
return false;
} else if (!imageUrl.equals(other.imageUrl))
return false;
+ if (landingPage == null) {
+ if (other.landingPage != null)
+ return false;
+ } else if (!landingPage.equals(other.landingPage))
+ return false;
if (mlAppAdminId == null) {
if (other.mlAppAdminId != null)
return false;
@@ -444,6 +501,11 @@ public class EPApp extends DomainVo {
return false;
} else if (!mlAppName.equals(other.mlAppName))
return false;
+ if (modeOfIntegration == null) {
+ if (other.modeOfIntegration != null)
+ return false;
+ } else if (!modeOfIntegration.equals(other.modeOfIntegration))
+ return false;
if (motsId == null) {
if (other.motsId != null)
return false;
@@ -459,16 +521,16 @@ public class EPApp extends DomainVo {
return false;
} else if (!nameSpace.equals(other.nameSpace))
return false;
- if (notes == null) {
- if (other.notes != null)
- return false;
- } else if (!notes.equals(other.notes))
- return false;
if (open == null) {
if (other.open != null)
return false;
} else if (!open.equals(other.open))
return false;
+ if (rolesInAAF == null) {
+ if (other.rolesInAAF != null)
+ return false;
+ } else if (!rolesInAAF.equals(other.rolesInAAF))
+ return false;
if (!Arrays.equals(thumbnail, other.thumbnail))
return false;
if (uebKey == null) {
@@ -486,16 +548,13 @@ public class EPApp extends DomainVo {
return false;
} else if (!uebTopicName.equals(other.uebTopicName))
return false;
- if (url == null) {
- if (other.url != null)
- return false;
- } else if (!url.equals(other.url))
- return false;
- if (username == null) {
- if (other.username != null)
+ if (usesCadi == null) {
+ if (other.usesCadi != null)
return false;
- } else if (!username.equals(other.username))
+ } else if (!usesCadi.equals(other.usesCadi))
return false;
return true;
}
+
+
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java
new file mode 100644
index 00000000..ae6d12cd
--- /dev/null
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EpAppType.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.domain;
+
+public interface EpAppType {
+ public static final int GUI = 1;
+ public static final int HYPERLINK = 2;
+ public static final int NONGUI = 3;
+
+ public static final String GUI_STR = "gui";
+ public static final String HYPERLINK_STR = "hyperlink";
+ public static final String NONGUI_STR = "nongui";
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java
index 78b40473..e96485d8 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java
@@ -72,6 +72,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.onap.portalsdk.core.onboarding.util.AuthUtil;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
import org.onap.portalsdk.core.util.SystemProperties;
@@ -253,7 +255,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor {
throw new Exception("Invalid credentials!");
}
else {
- final String appUsername = application.getUsername();
+ final String appUsername = application.getAppBasicAuthUsername();
logger.debug(EELFLoggerDelegate.debugLogger, "appUsername : {}",appUsername);
String[] accountNamePassword = EcompPortalUtils.getUserNamePassword(authHeader);
@@ -317,8 +319,8 @@ public class PortalResourceInterceptor extends ResourceInterceptor {
throw new Exception("Invalid credentials!");
}
else {
- final String appUsername = application.getUsername();
- final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppPassword());
+ final String appUsername = application.getAppBasicAuthUsername();
+ final String dbDecryptedPwd = CipherUtil.decryptPKC(application.getAppBasicAuthPassword());
if (appUsername.equals(accountNamePassword[0]) && dbDecryptedPwd.equals(accountNamePassword[1])) {
return true;
}
@@ -370,7 +372,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor {
String result = "";
if (encrypted != null && encrypted.length() > 0) {
try {
- result = CipherUtil.decryptPKC(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ result = CipherUtil.decryptPKC(encrypted, KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
throw e;
@@ -384,7 +386,7 @@ public class PortalResourceInterceptor extends ResourceInterceptor {
if (decryptedPwd != null && decryptedPwd.length() > 0) {
try {
result = CipherUtil.encryptPKC(decryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
throw e;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java
index 6950bdda..969ccc5f 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java
@@ -349,7 +349,7 @@ public class AdminRolesServiceImpl implements AdminRolesService {
for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) {
EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id);
try {
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_");
HttpEntity<String> entity = new HttpEntity<>(headers);
String name = "";
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
index 09d78046..ab504fba 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
@@ -67,6 +67,8 @@ import org.onap.portalapp.util.SystemType;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.util.SystemProperties;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
@@ -176,8 +178,8 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if (externalApp != null) {
String appBaseUri = (type == SystemType.APPLICATION) ? externalApp.getAppRestEndpoint() : "";
- String username = (type == SystemType.APPLICATION) ? externalApp.getUsername(): "";
- String encriptedPwd = (type == SystemType.APPLICATION) ? externalApp.getAppPassword(): "";
+ String username = (type == SystemType.APPLICATION) ? externalApp.getAppBasicAuthUsername(): "";
+ String encriptedPwd = (type == SystemType.APPLICATION) ? externalApp.getAppBasicAuthPassword(): "";
String appName = (type == SystemType.APPLICATION) ? externalApp.getName(): "";
String decreptedAppPwd = StringUtils.EMPTY;
@@ -194,7 +196,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if(!encriptedPwd.isEmpty() || encriptedPwd != null || StringUtils.isEmpty(encriptedPwd)){
try {
decreptedAppPwd = CipherUtil.decryptPKC(encriptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "createClientFor failed to decrypt", e);
}
@@ -202,20 +204,20 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
WebClient client = createClientForPath(appBaseUri, restPath);
- if(externalApp.getAppPassword().isEmpty() || externalApp.getAppPassword()==null){
+ if(externalApp.getAppBasicAuthPassword().isEmpty() || externalApp.getAppBasicAuthPassword()==null){
logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}");
externalApp = appsCacheService.getApp(1L);
logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp);
- String mechidUsername=externalApp.getUsername();
+ String mechidUsername=externalApp.getAppBasicAuthUsername();
logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername);
- String password=externalApp.getAppPassword();
+ String password=externalApp.getAppBasicAuthPassword();
String decreptedexternalAppPwd = StringUtils.EMPTY;
try {
decreptedexternalAppPwd = CipherUtil.decryptPKC(password,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e);
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java
index 98b0f127..151430d3 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java
@@ -52,6 +52,8 @@ import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
import org.onap.portalapp.validation.DataValidator;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
@@ -229,7 +231,7 @@ public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{
if (encryptedPwd != null && encryptedPwd.length() > 0) {
try {
result = CipherUtil.decryptPKC(encryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword() failed", e);
throw e;
@@ -243,7 +245,7 @@ public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{
if (decryptedPwd != null && decryptedPwd.length() > 0) {
try {
result = CipherUtil.encryptPKC(decryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
throw e;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
index 126d6276..54510d2c 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
@@ -94,6 +94,8 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.ueb.Helper;
import org.onap.portalsdk.core.onboarding.ueb.TopicManager;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
import org.onap.portalsdk.core.service.DataAccessService;
@@ -147,17 +149,17 @@ public class EPAppCommonServiceImpl implements EPAppService {
public Boolean onboardingAppFieldsValidation(OnboardingApp onboardingApp) {
//FieldsValidator fieldsValidator = new FieldsValidator();
- if ((!onboardingApp.restrictedApp) &&( onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.restrictedApp == null
- || onboardingApp.url == null || onboardingApp.url.length() == 0 || onboardingApp.restUrl == null || onboardingApp.restUrl.length() == 0
- || onboardingApp.username == null || onboardingApp.username.length() == 0
- || onboardingApp.isOpen == null
- || (onboardingApp.id != null && onboardingApp.id.equals(ECOMP_APP_ID)))
+ if ((!onboardingApp.getRestrictedApp()) &&( onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0 || onboardingApp.getRestrictedApp() == null
+ || onboardingApp.getLandingPage() == null || onboardingApp.getLandingPage().length() == 0 || onboardingApp.getRestUrl() == null || onboardingApp.getRestUrl().length() == 0
+ || onboardingApp.getAppBasicAuthUsername() == null || onboardingApp.getAppBasicAuthUsername().length() == 0
+ || onboardingApp.getIsOpen() == null
+ || (onboardingApp.getId() != null && onboardingApp.getId().equals(ECOMP_APP_ID)))
// For a normal app (appType == PortalConstants.PortalAppId),
// these fields must be filled
// in.
// For a restricted app (appType==2), they will be empty.
- || ((onboardingApp.restrictedApp) && (onboardingApp.name == null || onboardingApp.name.length() == 0
- || onboardingApp.url == null || onboardingApp.url.length() == 0 || onboardingApp.isOpen == null))) {
+ || ((onboardingApp.getRestrictedApp()) && (onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0
+ || onboardingApp.getLandingPage() == null || onboardingApp.getLandingPage().length() == 0 || onboardingApp.getIsOpen() == null))) {
return false;
}
return true;
@@ -165,8 +167,8 @@ public class EPAppCommonServiceImpl implements EPAppService {
}
private Boolean onboardingInactiveAppFieldsForValidation(OnboardingApp onboardingApp) {
- if (onboardingApp.name == null || onboardingApp.name.length() == 0
- || onboardingApp.isOpen == null) {
+ if (onboardingApp.getAppName() == null || onboardingApp.getAppName().length() == 0
+ || onboardingApp.getIsOpen() == null) {
return false;
}
return true;
@@ -174,28 +176,28 @@ public class EPAppCommonServiceImpl implements EPAppService {
protected FieldsValidator onboardingAppFieldsChecker(OnboardingApp onboardingApp) {
FieldsValidator fieldsValidator = new FieldsValidator();
- if (onboardingApp.isCentralAuth) {
- if (!onboardingApp.isEnabled) {
+ if (onboardingApp.getRolesInAAF()) {
+ if (!onboardingApp.getIsEnabled()) {
if (!onboardingInactiveAppFieldsForValidation(onboardingApp)) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
- } else if (onboardingApp.isEnabled) {
- if (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.nameSpace == null
- || onboardingApp.nameSpace.length() == 0) {
+ } else if (onboardingApp.getIsEnabled()) {
+ if (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.getNameSpace() == null
+ || onboardingApp.getNameSpace().length() == 0) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
}
} else {
- if (!onboardingApp.isEnabled) {
+ if (!onboardingApp.getIsEnabled()) {
if (!onboardingInactiveAppFieldsForValidation(onboardingApp)) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
- } else if (onboardingApp.isEnabled) {
- if(onboardingApp.restrictedApp && onboardingAppFieldsValidation(onboardingApp) == false){
+ } else if (onboardingApp.getIsEnabled()) {
+ if(onboardingApp.getRestrictedApp() && onboardingAppFieldsValidation(onboardingApp) == false){
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
- else if (!onboardingApp.restrictedApp && (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.appPassword == null
- || onboardingApp.appPassword.length() == 0)) {
+ else if (!onboardingApp.getRestrictedApp() && (onboardingAppFieldsValidation(onboardingApp) == false || onboardingApp.getAppBasicAuthPassword() == null
+ || onboardingApp.getAppBasicAuthPassword().length() == 0)) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
}
@@ -268,15 +270,15 @@ public class EPAppCommonServiceImpl implements EPAppService {
ecompApp.setId(app.getId());
ecompApp.setName(app.getName());
ecompApp.setImageUrl(app.getImageUrl());
- ecompApp.setDescription(app.getDescription());
- ecompApp.setNotes(app.getNotes());
- ecompApp.setUrl(app.getUrl());
- ecompApp.setAlternateUrl(app.getAlternateUrl());
+ ecompApp.setDescription(app.getAppDescription());
+ ecompApp.setNotes(app.getAppNotes());
+ ecompApp.setUrl(app.getLandingPage());
+ ecompApp.setAlternateUrl(app.getAlternateLandingPage());
ecompApp.setUebTopicName(app.getUebTopicName());
//ecompApp.setUebKey(app.getUebKey());
ecompApp.setUebSecret(app.getUebSecret());
ecompApp.setEnabled(app.getEnabled());
- ecompApp.setCentralAuth(app.getCentralAuth());
+ ecompApp.setCentralAuth(app.getRolesInAAF());
ecompApp.setNameSpace(app.getNameSpace());
ecompApp.setRestrictedApp(app.isRestrictedApp());
ecompAppList.add(ecompApp);
@@ -381,7 +383,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
if (apps.size() > 0) {
EPApp app = apps.get(0);
if (!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
- app.setCentralAuth(false);
+ app.setRolesInAAF(false);
}
return app;
} else{
@@ -582,14 +584,14 @@ public class EPAppCommonServiceImpl implements EPAppService {
FieldsValidator fieldsValidator = new FieldsValidator();
if(onboardingApp.isCentralAuth){
if (onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.url == null
- || onboardingApp.url.length() == 0 || onboardingApp.restrictedApp == null
- || onboardingApp.isOpen == null || onboardingApp.isEnabled == null
- || (onboardingApp.id != null && ECOMP_APP_ID.equals(onboardingApp.id.toString()))
+ || onboardingApp.url.length() == 0 || onboardingApp.getRestrictedApp() == null
+ || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null
+ || (onboardingApp.getId() != null && ECOMP_APP_ID.equals(onboardingApp.getId().toString()))
// For a normal app (appType == PortalConstants.PortalAppId),
// these fields must be filled
// in.
// For a restricted app (appType==2), they will be empty.
- || ((!onboardingApp.restrictedApp) && (onboardingApp.myLoginsAppName == null
+ || ((!onboardingApp.getRestrictedApp()) && (onboardingApp.myLoginsAppName == null
|| onboardingApp.myLoginsAppName.length() == 0 || onboardingApp.myLoginsAppOwner == null
|| onboardingApp.myLoginsAppOwner.length() == 0 || onboardingApp.username == null
|| onboardingApp.username.length() == 0 ))) {
@@ -598,14 +600,14 @@ public class EPAppCommonServiceImpl implements EPAppService {
}else{
if (onboardingApp.name == null || onboardingApp.name.length() == 0 || onboardingApp.url == null
- || onboardingApp.url.length() == 0 || onboardingApp.restrictedApp == null
- || onboardingApp.isOpen == null || onboardingApp.isEnabled == null
- || (onboardingApp.id != null && ECOMP_APP_ID.equals(onboardingApp.id.toString()))
+ || onboardingApp.url.length() == 0 || onboardingApp.getRestrictedApp() == null
+ || onboardingApp.getIsOpen() == null || onboardingApp.getIsEnabled() == null
+ || (onboardingApp.getId() != null && ECOMP_APP_ID.equals(onboardingApp.getId().toString()))
// For a normal app (appType == PortalConstants.PortalAppId),
// these fields must be filled
// in.
// For a restricted app (appType==2), they will be empty.
- || ((!onboardingApp.restrictedApp) && (onboardingApp.myLoginsAppName == null
+ || ((!onboardingApp.getRestrictedApp()) && (onboardingApp.myLoginsAppName == null
|| onboardingApp.myLoginsAppName.length() == 0 || onboardingApp.myLoginsAppOwner == null
|| onboardingApp.myLoginsAppOwner.length() == 0 || onboardingApp.username == null
|| onboardingApp.username.length() == 0 || onboardingApp.appPassword == null
@@ -815,7 +817,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
}
return finalsortedAppsByManual;
}
-
+
@Override
public List<OnboardingApp> getOnboardingApps() {
@SuppressWarnings("unchecked")
@@ -823,7 +825,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
for (EPApp app : apps) {
OnboardingApp onboardingApp = new OnboardingApp();
- app.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);//to hide password from get request
+ app.setAppBasicAuthPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);//to hide password from get request
createOnboardingFromApp(app, onboardingApp);
onboardingAppsList.add(onboardingApp);
}
@@ -846,7 +848,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
onboardingAppsList = getOnboardingApps();
final List<Integer> userAdminApps1 = userAdminApps;
- List<OnboardingApp> userApplicationAdmins = onboardingAppsList.stream().filter(x -> userAdminApps1.contains((int) (long)x.id)).collect(Collectors.toList());
+ List<OnboardingApp> userApplicationAdmins = onboardingAppsList.stream().filter(x -> userAdminApps1.contains((int) (long)x.getId())).collect(Collectors.toList());
return userApplicationAdmins;
}
@@ -855,7 +857,8 @@ public class EPAppCommonServiceImpl implements EPAppService {
public List<OnboardingApp> getEnabledNonOpenOnboardingApps() {
@SuppressWarnings("unchecked")
List<EPApp> apps = dataAccessService.getList(EPApp.class,
- " where enabled = true and open = false and id!=" + ECOMP_APP_ID, null, null);
+ " where enabled = true and open = false and app_type!= 3 and id!=" + ECOMP_APP_ID, null, null);
+
List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
for (EPApp app : apps) {
OnboardingApp onboardingApp = new OnboardingApp();
@@ -870,13 +873,13 @@ public class EPAppCommonServiceImpl implements EPAppService {
boolean duplicatedNameSpace = false;
boolean duplicatedName = false;
List<EPApp> apps;
- if (onboardingApp.id == null) {
+ if (onboardingApp.getId() == null) {
List<Criterion> restrictionsList = new ArrayList<Criterion>();
- Criterion nameCrit = Restrictions.eq("name",onboardingApp.name);
+ Criterion nameCrit = Restrictions.eq("name",onboardingApp.getAppName());
Criterion nameSpaceCrit = null;
Criterion orCrit = null;
- if (onboardingApp.isCentralAuth) {
- nameSpaceCrit = Restrictions.eq("nameSpace", onboardingApp.nameSpace);
+ if (onboardingApp.getRolesInAAF()) {
+ nameSpaceCrit = Restrictions.eq("nameSpace", onboardingApp.getNameSpace());
orCrit = Restrictions.or(nameCrit, nameSpaceCrit);
} else
orCrit = Restrictions.or(nameCrit);
@@ -884,12 +887,12 @@ public class EPAppCommonServiceImpl implements EPAppService {
apps = (List<EPApp>) dataAccessService.getList(EPApp.class, null, restrictionsList, null);
} else {
List<Criterion> restrictionsList = new ArrayList<Criterion>();
- Criterion idCrit =Restrictions.eq("id", onboardingApp.id);
- Criterion nameCrit = Restrictions.eq("name",onboardingApp.name);
+ Criterion idCrit =Restrictions.eq("id", onboardingApp.getId());
+ Criterion nameCrit = Restrictions.eq("name",onboardingApp.getAppName());
Criterion nameSpaceCrit = null;
Criterion orCrit= null;
- if (onboardingApp.isCentralAuth) {
- nameSpaceCrit = Restrictions.eq("nameSpace",onboardingApp.nameSpace);
+ if (onboardingApp.getRolesInAAF()) {
+ nameSpaceCrit = Restrictions.eq("nameSpace",onboardingApp.getNameSpace());
orCrit = Restrictions.or(idCrit, nameSpaceCrit, nameCrit);
}
else
@@ -900,16 +903,16 @@ public class EPAppCommonServiceImpl implements EPAppService {
}
for (EPApp app : apps) {
- if (onboardingApp.id != null && onboardingApp.id.equals(app.getId())) {
+ if (onboardingApp.getId() != null && onboardingApp.getId().equals(app.getId())) {
continue;
}
- if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.name)) {
+ if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.getAppName())) {
duplicatedName = true;
if (duplicatedName) {
break;
}
}
- if (!duplicatedNameSpace && app.getNameSpace().equalsIgnoreCase(onboardingApp.nameSpace)) {
+ if (!duplicatedNameSpace && app.getNameSpace().equalsIgnoreCase(onboardingApp.getNameSpace())) {
duplicatedNameSpace = true;
if (duplicatedNameSpace) {
break;
@@ -937,8 +940,8 @@ public class EPAppCommonServiceImpl implements EPAppService {
validateOnboardingApp(modifiedOnboardingApp, fieldsValidator);
}
if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
- if (modifiedOnboardingApp.id != null) {
- updateApp(modifiedOnboardingApp.id, modifiedOnboardingApp, fieldsValidator, user);
+ if (modifiedOnboardingApp.getId() != null) {
+ updateApp(modifiedOnboardingApp.getId(), modifiedOnboardingApp, fieldsValidator, user);
} else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
}
@@ -953,7 +956,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
validateOnboardingApp(newOnboardingApp, fieldsValidator);
}
if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
- if (newOnboardingApp.id == null) {
+ if (newOnboardingApp.getId() == null) {
updateApp(null, newOnboardingApp, fieldsValidator, user);
} else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
@@ -1211,7 +1214,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
logger.debug(EELFLoggerDelegate.debugLogger, "LR: entering updateApp");
// Separate out the code for a restricted app, since it doesn't need any
// of the UEB code.
- if (onboardingApp.restrictedApp) {
+ if (Boolean.TRUE.equals(onboardingApp.getRestrictedApp())) {
boolean result = false;
Session localSession = null;
Transaction transaction = null;
@@ -1234,7 +1237,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
createAppFromOnboarding(app, onboardingApp, localSession);
localSession.saveOrUpdate(app);
// Enable or disable all menu items associated with this app
- setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
+ setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId);
transaction.commit();
result = true;
} catch (Exception e) {
@@ -1300,7 +1303,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
logger.debug(EELFLoggerDelegate.debugLogger,
"updateRestrictedApp: finished calling localSession.saveOrUpdate");
// Enable or disable all menu items associated with this app
- setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
+ setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId);
logger.debug(EELFLoggerDelegate.debugLogger,
"updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled");
transaction.commit();
@@ -1405,10 +1408,10 @@ public class EPAppCommonServiceImpl implements EPAppService {
topicManager.createTopic(
PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
- appMailboxName, "ECOMP outbox for app" + onboardingApp.name);
+ appMailboxName, "ECOMP outbox for app" + onboardingApp.getAppName());
successfullyCreatedMailbox = true;
logger.debug(EELFLoggerDelegate.debugLogger,
- "Successfully created " + appMailboxName + " for App " + onboardingApp.name);
+ "Successfully created " + appMailboxName + " for App " + onboardingApp.getAppName());
logger.debug(EELFLoggerDelegate.debugLogger, " Key = " + appKey + " Secret = "
+ appSecret + " generated using = " + user.getEmail());
break;
@@ -1487,7 +1490,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
logger.debug(EELFLoggerDelegate.debugLogger,
"LR: updateApp: finished calling localSession.saveOrUpdate");
// Enable or disable all menu items associated with this app
- setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
+ setFunctionalMenuItemsEnabled(localSession, onboardingApp.getIsEnabled(), appId);
logger.debug(EELFLoggerDelegate.debugLogger,
"LR: updateApp: finished calling setFunctionalMenuItemsEnabled");
transaction.commit();
@@ -1528,27 +1531,35 @@ public class EPAppCommonServiceImpl implements EPAppService {
*/
@Override
public void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp) {
- onboardingApp.id = app.getId();
- onboardingApp.name = app.getName();
- onboardingApp.imageUrl = app.getImageUrl();
- onboardingApp.description = app.getDescription();
- onboardingApp.notes = app.getNotes();
- onboardingApp.url = app.getUrl();
- onboardingApp.alternateUrl = app.getAlternateUrl();
- onboardingApp.restUrl = app.getAppRestEndpoint();
- onboardingApp.isOpen = app.getOpen();
- onboardingApp.isEnabled = app.getEnabled();
- onboardingApp.username = app.getUsername();
- onboardingApp.appPassword = (app.getAppPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD)) ? EPCommonSystemProperties.APP_DISPLAY_PASSWORD :decryptedPassword(app.getAppPassword(), app);
- onboardingApp.uebTopicName = app.getUebTopicName();
- onboardingApp.uebKey = app.getUebKey();
- onboardingApp.uebSecret = app.getUebSecret();
- onboardingApp.isCentralAuth = app.getCentralAuth();
- onboardingApp.nameSpace = app.getNameSpace();
+ onboardingApp.setId(app.getId());
+ onboardingApp.setAppName(app.getName());
+ onboardingApp.setImageUrl(app.getImageUrl());
+ onboardingApp.setAppDescription(app.getAppDescription());
+ onboardingApp.setAppNotes(app.getAppNotes());
+ onboardingApp.setLandingPage(app.getLandingPage());
+ onboardingApp.setAlternateLandingPage(app.getAlternateLandingPage());
+ onboardingApp.setRestUrl(app.getAppRestEndpoint());
+ onboardingApp.setIsOpen(app.getOpen());
+ onboardingApp.setIsEnabled(app.getEnabled());
+ onboardingApp.setAppBasicAuthUsername(app.getAppBasicAuthUsername());
+
+ String effectivePwd = null;
+ if (app.getAppBasicAuthPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD))
+ effectivePwd = EPCommonSystemProperties.APP_DISPLAY_PASSWORD;
+ else
+ effectivePwd = decryptedPassword(app.getAppBasicAuthPassword(), app);
+
+ onboardingApp.setAppBasicAuthPassword(effectivePwd);
+ onboardingApp.setUebTopicName(app.getUebTopicName());
+ onboardingApp.setUebKey(app.getUebKey());
+ onboardingApp.setUebSecret(app.getUebSecret());
+ onboardingApp.setRolesInAAF(app.getRolesInAAF());
+ onboardingApp.setNameSpace(app.getNameSpace());
onboardingApp.setRestrictedApp(app.isRestrictedApp());
- // if (app.getThumbnail() != null)
- // onboardingApp.thumbnail = new
- // String(Base64.getEncoder().encode(app.getThumbnail()));
+ onboardingApp.setModeOfIntegration(app.getModeOfIntegration());
+ onboardingApp.setAppAck(app.getAppAck());
+ onboardingApp.setUsesCadi(app.getUsesCadi());
+ onboardingApp.setApplicationType(app.getAppType().toString());
}
/**
@@ -1561,26 +1572,31 @@ public class EPAppCommonServiceImpl implements EPAppService {
* @return The first argument.
*/
protected EPApp createAppFromOnboarding(EPApp app, OnboardingApp onboardingApp, Session localSession) {
- app.setName(onboardingApp.name);
- app.setDescription(onboardingApp.description);
- app.setNotes(onboardingApp.notes);
- app.setUrl(onboardingApp.url);
- app.setAlternateUrl(onboardingApp.alternateUrl);
- app.setAppRestEndpoint(onboardingApp.restUrl);
- app.setOpen(onboardingApp.isOpen);
- app.setEnabled(onboardingApp.isEnabled);
- app.setUsername(onboardingApp.username);
- if(!onboardingApp.appPassword.equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD))
- app.setAppPassword(this.encryptedPassword(onboardingApp.appPassword, app));
+ app.setName(onboardingApp.getAppName());
+ app.setAppDescription(onboardingApp.getAppDescription());
+ app.setAppNotes(onboardingApp.getAppNotes());
+ app.setLandingPage(onboardingApp.getLandingPage());
+ app.setAlternateLandingPage(onboardingApp.getAlternateLandingPage());
+ app.setAppRestEndpoint(onboardingApp.getRestUrl());
+ app.setOpen(onboardingApp.getIsOpen());
+ app.setEnabled(onboardingApp.getIsEnabled());
+ app.setAppBasicAuthUsername(onboardingApp.getAppBasicAuthUsername());
+ if(!onboardingApp.getAppBasicAuthPassword().equals(EPCommonSystemProperties.APP_DISPLAY_PASSWORD))
+ app.setAppBasicAuthPassword(this.encryptedPassword(onboardingApp.getAppBasicAuthPassword(), app));
//app.setUebTopicName(onboardingApp.uebTopicName);
- app.setUebKey(onboardingApp.uebKey);
- app.setUebSecret(onboardingApp.uebSecret);
- app.setCentralAuth(onboardingApp.isCentralAuth);
- app.setNameSpace(onboardingApp.nameSpace);
- app.setRestrictedApp(onboardingApp.restrictedApp);
- if (!StringUtils.isEmpty(onboardingApp.thumbnail)) {
+ app.setUebKey(onboardingApp.getUebKey());
+ app.setUebSecret(onboardingApp.getUebSecret());
+ app.setRolesInAAF(onboardingApp.getRolesInAAF());
+ app.setNameSpace(onboardingApp.getNameSpace());
+ app.setAppType(new Integer(onboardingApp.getApplicationType()));
+ app.setModeOfIntegration(onboardingApp.getModeOfIntegration());
+ app.setAppAck(onboardingApp.getAppAck());
+ app.setUsesCadi(onboardingApp.getUsesCadi());
+
+
+ if (!StringUtils.isEmpty(onboardingApp.getThumbnail())) {
logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: onboarding thumbnail is NOT empty");
- String[] splitBase64Thumbnail = onboardingApp.thumbnail.split("base64,");
+ String[] splitBase64Thumbnail = onboardingApp.getThumbnail().split("base64,");
logger.debug(EELFLoggerDelegate.debugLogger,
"createAppFromOnboarding: length of splitBase64Thumbnail: " + splitBase64Thumbnail.length);
if (splitBase64Thumbnail.length > 1) {
@@ -1592,7 +1608,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
app.setImageUrl(constructImageName(onboardingApp));
app.setThumbnail(decodedImage);
}
- } else if (app.getThumbnail() != null && onboardingApp.imageLink == null) {
+ } else if (app.getThumbnail() != null && onboardingApp.getImageLink() == null) {
// The thumbnail that came in from the json is empty; the previous
// thumbnail is NOT empty. Must delete it.
logger.debug(EELFLoggerDelegate.debugLogger,
@@ -1607,7 +1623,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
}
protected String constructImageName(OnboardingApp onboardingApp) {
- return "portal_" + String.valueOf(onboardingApp.url.hashCode() + "_" + (int) (Math.random() * 100000.0))
+ return "portal_" + String.valueOf(onboardingApp.getLandingPage().hashCode() + "_" + (int) (Math.random() * 100000.0))
+ ".png";
}
@@ -1617,7 +1633,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
if (encryptedAppPwd != null && !encryptedAppPwd.isEmpty()) {
try {
result = CipherUtil.decryptPKC(encryptedAppPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed for app " + app.getName(), e);
}
@@ -1630,7 +1646,7 @@ public class EPAppCommonServiceImpl implements EPAppService {
if (decryptedAppPwd != null && !decryptedAppPwd.isEmpty()) {
try {
result = CipherUtil.encryptPKC(decryptedAppPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed for app " + app.getName(), e);
}
@@ -1929,9 +1945,11 @@ public class EPAppCommonServiceImpl implements EPAppService {
logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists: Connecting to External Auth system for : "+namespace);
ResponseEntity<String> response = null;
try {
- response = template
- .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
- + "nss/" + namespace, HttpMethod.GET, entity, String.class);
+
+ String namespaceUrl = SystemProperties.
+ getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "nss/" + namespace;
+
+ response = template.exchange(namespaceUrl, HttpMethod.GET, entity, String.class);
logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists for"+ namespace ,
response.getStatusCode().value());
if (response.getStatusCode().value() == 200) {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java
index 241468c3..ad06dd96 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java
@@ -1183,13 +1183,13 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic
.setModified(epApp.getModified()).setCreatedId(epApp.getCreatedId())
.setModifiedId(epApp.getModifiedId()).setRowNum(epApp.getRowNum())
.setName(epApp.getName()).setImageUrl(epApp.getImageUrl())
- .setDescription(epApp.getDescription()).setNotes(epApp.getNotes())
- .setUrl(epApp.getUrl()).setAlternateUrl(epApp.getAlternateUrl())
+ .setDescription(epApp.getAppDescription()).setNotes(epApp.getAppNotes())
+ .setUrl(epApp.getLandingPage()).setAlternateUrl(epApp.getLandingPage())
.setRestEndpoint(epApp.getAppRestEndpoint()).setMlAppName(epApp.getMlAppName())
.setMlAppAdminId(epApp.getMlAppAdminId()).setMotsId(String.valueOf(epApp.getMotsId()))
- .setAppPassword(epApp.getAppPassword()).setOpen(String.valueOf(epApp.getOpen()))
+ .setAppPassword(epApp.getAppBasicAuthPassword()).setOpen(String.valueOf(epApp.getOpen()))
.setEnabled(String.valueOf(epApp.getEnabled())).setThumbnail(epApp.getThumbnail())
- .setUsername(epApp.getUsername()).setUebKey(epApp.getUebKey())
+ .setUsername(epApp.getAppBasicAuthUsername()).setUebKey(epApp.getUebKey())
.setUebSecret(epApp.getUebSecret()).setUebTopicName(epApp.getUebTopicName())
.createCentralApp();
cenApp.setAppPassword(EPCommonSystemProperties.APP_DISPLAY_PASSWORD);
@@ -3005,7 +3005,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic
params.put("uebKey", app.getUebKey());
List<BulkUploadUserRoles> userRolesList = null;
Integer userRolesAdded = 0;
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
userRolesList = dataAccessService.executeNamedQuery("getBulkUserRoles", params, null);
for (BulkUploadUserRoles userRolesUpload : userRolesList) {
if (!userRolesUpload.getOrgUserId().equals("su1234")) {
@@ -3602,7 +3602,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic
params.put("roleId", String.valueOf(roleId));
List<BulkUploadUserRoles> userRolesList = null;
Integer userRolesAdded = 0;
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
userRolesList = dataAccessService.executeNamedQuery("getBulkUsersForSingleRole", params, null);
for (BulkUploadUserRoles userRolesUpload : userRolesList) {
userRolesUpload.setRoleName(modifiedRoleName);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java
index 31cb8a45..df8b59d8 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java
@@ -50,6 +50,8 @@ import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
import org.onap.portalapp.portal.utils.EcompPortalUtils;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@@ -177,7 +179,7 @@ public class MicroserviceProxyServiceImpl implements MicroserviceProxyService {
if (encryptedPwd != null && encryptedPwd.length() > 0) {
try {
result = CipherUtil.decryptPKC(encryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
throw e;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
index 451500d6..9d9fde3a 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
@@ -52,6 +52,8 @@ import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
@@ -197,7 +199,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
if (encryptedPwd != null && !encryptedPwd.isEmpty()) {
try {
result = CipherUtil.decryptPKC(encryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
throw e;
@@ -211,7 +213,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
if (decryptedPwd != null && !decryptedPwd.isEmpty()) {
try {
result = CipherUtil.encryptPKC(decryptedPwd,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed", e);
throw e;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java
index c766106d..07c1ea64 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java
@@ -40,8 +40,6 @@ package org.onap.portalapp.portal.service;
import java.util.ArrayList;
import java.util.List;
-import org.onap.portalapp.portal.service.SearchService;
-import org.onap.portalapp.portal.service.SearchServiceImpl;
import org.onap.portalapp.portal.domain.EPUser;
import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
index 4924e654..7a7f9ee4 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
@@ -376,7 +376,7 @@ public class UserRolesCommonServiceImpl {
.setParameter("appId",appId)
.list();
for (EPRole role : roles) {
- if (!extRequestValue && app.getCentralAuth()) {
+ if (!extRequestValue && app.getRolesInAAF()) {
rolesMap.put(role.getId(), role);
} else {
rolesMap.put(role.getAppRoleId(), role);
@@ -1086,12 +1086,11 @@ public class UserRolesCommonServiceImpl {
}
}
}
-
applyChangesToUserAppRolesForMyLoginsRequest(user, appId);
Boolean systemUser = (newAppRolesForUser.getIsSystemUser() != null ? newAppRolesForUser.getIsSystemUser() : false);
- if ((app.getCentralAuth() || app.getId().equals(PortalConstants.PORTAL_APP_ID)) && systemUser) {
+ if ((app.getRolesInAAF() || app.getId().equals(PortalConstants.PORTAL_APP_ID)) && systemUser) {
Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
applicationsRestClientService, appId, userId);
@@ -1108,13 +1107,16 @@ public class UserRolesCommonServiceImpl {
result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal",
systemUser,rolesGotDeletedByApprover,false);
- }else if (!app.getCentralAuth() && systemUser)
+ }else if (!app.getRolesInAAF() && systemUser)
{
throw new Exception("For non-centralized application we cannot add systemUser");
}
else{ // if centralized app
- if (app.getCentralAuth()) {
- if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+ if (app.getRolesInAAF()) {
+
+ if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && (app.getAppAck() != null && app.getAppAck())) {
+ logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser: calling pushRemoteUser method for Central application");
+ logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser:"+app.getAppAck());
pushRemoteUser(roleInAppForUserList, userId, app, mapper, searchService,
applicationsRestClientService,false);
}
@@ -1125,7 +1127,6 @@ public class UserRolesCommonServiceImpl {
userRolesInLocalApp);
List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
-
// Apply changes in external Access system
updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList,
epRequestValue,false,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin);
@@ -1133,7 +1134,7 @@ public class UserRolesCommonServiceImpl {
result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal", systemUser,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin);
}
// In case if portal is not centralized then follow existing approach
- else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+ else if(!app.getRolesInAAF() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
applicationsRestClientService, appId, userId);
RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
@@ -1142,10 +1143,10 @@ public class UserRolesCommonServiceImpl {
result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal",false,rolesGotDeletedByApprover,false);
} else{// remote app
EPUser remoteAppUser = null;
- if(!app.getCentralAuth() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+ if(!app.getRolesInAAF() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){
remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
-
+
if (remoteAppUser == null) {
remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService);
}
@@ -1620,7 +1621,7 @@ public class UserRolesCommonServiceImpl {
}
//If Non-Centralized app make sure you sync app roles before assigning to user
- if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getCentralAuth()) {
+ if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getRolesInAAF()) {
logger.debug(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: Starting GET roles for app {}",app.getId());
EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, app.getId(), "/roles");
logger.debug(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: Finshed GET roles for app {} and payload {}",app.getId(), appRoles);
@@ -1647,12 +1648,13 @@ public class UserRolesCommonServiceImpl {
.anyMatch(roleList -> roleList.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
}
// if Centralized app
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
// We should add If user does not exist in remote application
try {
// If adding just account admin role dont make remote application user call or
// if request has only single non admin role then make remote call
if (!(app.getId().equals(PortalConstants.PORTAL_APP_ID) && reqType.equals("DELETE"))
+ && (app.getAppAck() != null && app.getAppAck())
&& ((checkIfAdminRoleExists && roleInAppForUserList.size() > 1)
|| (!checkIfAdminRoleExists && roleInAppForUserList.size() >= 1))) {
// check if admin role exist then delete
@@ -1662,6 +1664,7 @@ public class UserRolesCommonServiceImpl {
return (role.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
});
String orgUserIdNewOrExist = (userInfo.size() != 0 || !userInfo.isEmpty()) ? user.getOrgUserId() : orgUserId;
+
pushRemoteUser(remoteUserRoles, orgUserIdNewOrExist , app, mapper, searchService,
applicationsRestClientService,true);
}
@@ -1686,7 +1689,7 @@ public class UserRolesCommonServiceImpl {
result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType,false,rolesGotDeletedByApprover,false);
}
// If local application is not centralized
- else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+ else if(!app.getRolesInAAF() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
applicationsRestClientService, app.getId(), orgUserId);
RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
@@ -1896,7 +1899,7 @@ public class UserRolesCommonServiceImpl {
// for onap portal app, no need to make a remote call
List<Role> roleList = new ArrayList<>();
if (appId == PortalConstants.PORTAL_APP_ID) {
- if(app.getCentralAuth()){
+ if(app.getRolesInAAF()){
List<CentralV2Role> cenRoleList = externalAccessRolesService.getRolesForApp(app.getUebKey());
for(CentralV2Role cenRole : cenRoleList){
Role role = new Role();
@@ -1935,7 +1938,7 @@ public class UserRolesCommonServiceImpl {
EcompRole[] appRoles = null;
boolean checkIfUserisApplicationAccAdmin = false;
List<EcompRole> roles = new ArrayList<>();
- if (app.getCentralAuth()) {
+ if (app.getRolesInAAF()) {
final Map<String, Long> appParams = new HashMap<>();
appParams.put("appId", app.getId());
List<EPRole> applicationRoles = dataAccessService.executeNamedQuery("getActiveRolesOfApplication",
@@ -2038,14 +2041,14 @@ public class UserRolesCommonServiceImpl {
// If there is an exception in the rest client api, then null will
// be returned.
if (appRoles != null) {
- if(!app.getCentralAuth()) {
+ if(!app.getRolesInAAF()) {
syncAppRoles(sessionFactory, appId, appRoles);
}
EcompRole[] userAppRoles = null;
try {
try {
- if(app.getCentralAuth()){
+ if(app.getRolesInAAF()){
final Map<String, String> params = new HashMap<>();
final Map<String, Long> userParams = new HashMap<>();
params.put("orgUserIdValue", userId);
@@ -2315,7 +2318,7 @@ public class UserRolesCommonServiceImpl {
EPApp app = appsService.getApp(appId);
//If local or centralized application
- if (appId == PortalConstants.PORTAL_APP_ID || app.getCentralAuth()) {
+ if (appId == PortalConstants.PORTAL_APP_ID || app.getRolesInAAF()) {
Map<String, Object> params = new HashMap<>();
params.put("id", app.getId());
params.put("active", true);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java
index 37ad5add..d1b2a568 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java
@@ -38,6 +38,7 @@
package org.onap.portalapp.portal.transport;
import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portalapp.portal.domain.EpAppType;
/**
* Model of rows in the fn_app table; serialized as a message add or update an
@@ -45,81 +46,301 @@ import org.hibernate.validator.constraints.SafeHtml;
*/
public class OnboardingApp {
- public Long id;
+ private Long id;
@SafeHtml
- public String name;
+ private String appName;
@SafeHtml
- public String imageUrl;
+ private String imageUrl;
@SafeHtml
- public String imageLink;
+ private String imageLink;
@SafeHtml
- public String description;
+ private String appDescription;
@SafeHtml
- public String notes;
+ private String appNotes;
@SafeHtml
- public String url;
+ private String landingPage;
@SafeHtml
- public String alternateUrl;
+ private String alternateLandingPage;
@SafeHtml
- public String restUrl;
+ private String restUrl;
- public Boolean isOpen;
+ @SafeHtml
+ private String applicationType;
+
+ private Boolean isOpen;
- public Boolean isEnabled;
+ private Boolean isEnabled;
- public Long motsId;
+ private Long motsId;
@SafeHtml
- public String myLoginsAppName;
+ private String myLoginsAppName;
@SafeHtml
- public String myLoginsAppOwner;
+ private String myLoginsAppOwner;
@SafeHtml
- public String username;
+ private String appBasicAuthUsername;
@SafeHtml
- public String appPassword;
+ private String appBasicAuthPassword;
@SafeHtml
- public String thumbnail;
+ private String thumbnail;
@SafeHtml
- public String uebTopicName;
+ private String uebTopicName;
@SafeHtml
- public String uebKey;
+ private String uebKey;
@SafeHtml
- public String uebSecret;
+ private String uebSecret;
- public Boolean restrictedApp;
+ private Boolean restrictedApp;
- public Boolean isCentralAuth;
+ private Boolean rolesInAAF;
+ @SafeHtml
+ private String nameSpace;
+
@SafeHtml
- public String nameSpace;
+ private String modeOfIntegration;
+ private Boolean appAck;
+
+ private Boolean usesCadi;
+
/**
* Sets the name, myLoginsAppName, myLoginsAppOwner, username and
* appPassword fields to the empty string OR trims leading/trailing space,
* as appropriate.
*/
public void normalize() {
- this.name = (this.name == null) ? "" : this.name.trim();
+ this.appName = (this.appName == null) ? "" : this.appName.trim();
this.myLoginsAppName = (this.myLoginsAppName == null) ? "" : this.myLoginsAppName.trim();
this.myLoginsAppOwner = (this.myLoginsAppOwner == null) ? "" : this.myLoginsAppOwner.trim();
- this.username = (this.username == null) ? "" : this.username.trim();
- this.appPassword = (this.appPassword == null) ? "" : this.appPassword.trim();
+ this.appBasicAuthUsername = (this.appBasicAuthUsername == null) ? "" : this.appBasicAuthUsername.trim();
+ this.appBasicAuthPassword = (this.appBasicAuthPassword == null) ? "" : this.appBasicAuthPassword.trim();
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public String getImageLink() {
+ return imageLink;
+ }
+
+ public void setImageLink(String imageLink) {
+ this.imageLink = imageLink;
+ }
+
+ public String getAppDescription() {
+ return appDescription;
+ }
+
+ public void setAppDescription(String appDescription) {
+ this.appDescription = appDescription;
+ }
+
+ public String getAppNotes() {
+ return appNotes;
+ }
+
+ public void setAppNotes(String appNotes) {
+ this.appNotes = appNotes;
+ }
+
+ public String getLandingPage() {
+ return landingPage;
+ }
+
+ public void setLandingPage(String landingPage) {
+ this.landingPage = landingPage;
}
- public void setUebTopicName(String topicName) {
- this.uebTopicName = topicName;
+ public String getAlternateLandingPage() {
+ return alternateLandingPage;
}
- public void setUebKey(String key) {
- this.uebKey = key;
+ public void setAlternateLandingPage(String alternateLandingPage) {
+ this.alternateLandingPage = alternateLandingPage;
}
- public void setUebSecret(String secret) {
- this.uebSecret = secret;
+ public String getRestUrl() {
+ return restUrl;
}
- // Hide the implementation of restricted and normal app from the front end.
- // The json sent and received will include restrictedApp but not appType.
+ public void setRestUrl(String restUrl) {
+ this.restUrl = restUrl;
+ }
+
+ public Boolean getIsOpen() {
+ return isOpen;
+ }
+
+ public void setIsOpen(Boolean isOpen) {
+ this.isOpen = isOpen;
+ }
+
+ public Boolean getIsEnabled() {
+ return isEnabled;
+ }
+
+ public void setIsEnabled(Boolean isEnabled) {
+ this.isEnabled = isEnabled;
+ }
+
+ public Long getMotsId() {
+ return motsId;
+ }
+
+ public void setMotsId(Long motsId) {
+ this.motsId = motsId;
+ }
+
+ public String getMyLoginsAppName() {
+ return myLoginsAppName;
+ }
+
+ public void setMyLoginsAppName(String myLoginsAppName) {
+ this.myLoginsAppName = myLoginsAppName;
+ }
+
+ public String getMyLoginsAppOwner() {
+ return myLoginsAppOwner;
+ }
+
+ public void setMyLoginsAppOwner(String myLoginsAppOwner) {
+ this.myLoginsAppOwner = myLoginsAppOwner;
+ }
+
+ public String getAppBasicAuthUsername() {
+ return appBasicAuthUsername;
+ }
+
+ public void setAppBasicAuthUsername(String appBasicAuthUsername) {
+ this.appBasicAuthUsername = appBasicAuthUsername;
+ }
+
+ public String getAppBasicAuthPassword() {
+ return appBasicAuthPassword;
+ }
+
+ public void setAppBasicAuthPassword(String appBasicAuthPassword) {
+ this.appBasicAuthPassword = appBasicAuthPassword;
+ }
+
+ public String getThumbnail() {
+ return thumbnail;
+ }
+
+ public void setThumbnail(String thumbnail) {
+ this.thumbnail = thumbnail;
+ }
+
+ public String getUebTopicName() {
+ return uebTopicName;
+ }
+
+ public void setUebTopicName(String uebTopicName) {
+ this.uebTopicName = uebTopicName;
+ }
+
+ public String getUebKey() {
+ return uebKey;
+ }
+
+ public void setUebKey(String uebKey) {
+ this.uebKey = uebKey;
+ }
+
+ public String getUebSecret() {
+ return uebSecret;
+ }
+
+ public void setUebSecret(String uebSecret) {
+ this.uebSecret = uebSecret;
+ }
+
+ public Boolean getRestrictedApp() {
+ return restrictedApp;
+ }
public void setRestrictedApp(Boolean restrictedApp) {
this.restrictedApp = restrictedApp;
}
+
+ public Boolean getRolesInAAF() {
+ return rolesInAAF;
+ }
+
+ public void setRolesInAAF(Boolean rolesInAAF) {
+ this.rolesInAAF = rolesInAAF;
+ }
+
+ public String getNameSpace() {
+ return nameSpace;
+ }
+
+ public void setNameSpace(String nameSpace) {
+ this.nameSpace = nameSpace;
+ }
+
+ public String getModeOfIntegration() {
+ return modeOfIntegration;
+ }
+
+ public void setModeOfIntegration(String modeOfIntegration) {
+ this.modeOfIntegration = modeOfIntegration;
+ }
+
+ public Boolean getAppAck() {
+ return appAck;
+ }
+
+ public void setAppAck(Boolean appAck) {
+ this.appAck = appAck;
+ }
+
+ public Boolean getUsesCadi() {
+ return usesCadi;
+ }
+
+ public void setUsesCadi(Boolean usesCadi) {
+ this.usesCadi = usesCadi;
+ }
+
+ public String getApplicationType() {
+ return applicationType;
+ }
+
+ public void setApplicationType(String applicationType) {
+ this.applicationType = applicationType;
+ }
+
+ public Integer appTypePersistedValue() {
+ switch (this.getApplicationType()) {
+ case EpAppType.GUI_STR:
+ return EpAppType.GUI;
+ case EpAppType.HYPERLINK_STR:
+ return EpAppType.HYPERLINK;
+ case EpAppType.NONGUI_STR:
+ return EpAppType.NONGUI;
+ default:
+ return 0;
+ }
+ }
}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java
index e5543a36..3fc8c393 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java
@@ -61,6 +61,8 @@ import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
import org.onap.portalapp.portal.logging.logic.EPLogUtil;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.util.SystemProperties;
import org.slf4j.MDC;
import org.springframework.http.HttpHeaders;
@@ -435,7 +437,7 @@ public class EcompPortalUtils {
if (encrypted != null && encrypted.length() > 0) {
try {
result = CipherUtil.decryptPKC(encrypted,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
throw e;
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java
index 891f6d78..afe56368 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/MusicCookieCsrfTokenRepository.java
@@ -62,7 +62,6 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
-import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
public final class MusicCookieCsrfTokenRepository implements CsrfTokenRepository {
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java
index 14616b31..f65199c7 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java
@@ -61,6 +61,8 @@ import org.onap.portalsdk.core.exception.UrlAccessRestrictedException;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.util.SystemProperties;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
@@ -85,12 +87,12 @@ public class SessionCommunication {
String appResponse = "";
String appName = "";
int responseCode = 0;
- if (app != null && app.name != null && app.name != "") {
+ if (app != null && app.getAppName() != null && app.getAppName() != "") {
try {
- appName = app.name;
- String url = app.restUrl + "/sessionTimeOuts";
- String encriptedPwdDB = app.appPassword;
- String appUserName = app.username;
+ appName = app.getAppName();
+ String url = app.getRestUrl() + "/sessionTimeOuts";
+ String encriptedPwdDB = app.getAppBasicAuthPassword();
+ String appUserName = app.getAppBasicAuthUsername();
setLocalMDCContext(app, "/sessionTimeOuts", url);
@@ -157,12 +159,12 @@ public class SessionCommunication {
try {
if (app == null)
throw new Exception("SessionCommunication.pingSession: app is null");
- if (app != null && app.name != null && app.name != "") {
- appName = app.name;
+ if (app != null && app.getAppName() != null && app.getAppName() != "") {
+ appName = app.getAppName();
}
- String url = app.restUrl + "/updateSessionTimeOuts";
- String encriptedPwdDB = app.appPassword;
- String appUserName = app.username;
+ String url = app.getRestUrl() + "/updateSessionTimeOuts";
+ String encriptedPwdDB = app.getAppBasicAuthPassword();
+ String appUserName = app.getAppBasicAuthUsername();
setLocalMDCContext(app, "/updateSessionTimeOuts", url);
@@ -218,13 +220,13 @@ public class SessionCommunication {
public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception {
String appName = "Unknwon";
int responseCode = 0;
- if (app != null && app.name != null && app.name != "") {
+ if (app != null && app.getAppName() != null && app.getAppName() != "") {
try {
- appName = app.name;
- String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId;
+ appName = app.getAppName();
+ String url = app.getRestUrl() + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId;
- String encriptedPwdDB = app.appPassword;
- String appUserName = app.username;
+ String encriptedPwdDB = app.getAppBasicAuthPassword();
+ String appUserName = app.getAppBasicAuthUsername();
// String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
// SystemProperties.getProperty(SystemProperties.Decryption_Key));
@@ -287,7 +289,7 @@ public class SessionCommunication {
MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
}
MDC.put(EPCommonSystemProperties.FULL_URL, url);
- MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName);
+ MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.getMyLoginsAppName());
MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
}
@@ -332,19 +334,19 @@ public class SessionCommunication {
Map<String,String> headersMap = new HashMap<>();
EPApp externalApp = null;
- if(app.appPassword.isEmpty() || app.appPassword==null){
+ if(app.getAppBasicAuthPassword().isEmpty() || app.getAppBasicAuthPassword()==null){
logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}");
externalApp = appsCacheService.getApp(1L);
logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp);
- String mechidUsername=externalApp.getUsername();
+ String mechidUsername=externalApp.getAppBasicAuthUsername();
logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername);
- String password=externalApp.getAppPassword();
+ String password=externalApp.getAppBasicAuthPassword();
String decreptedexternalAppPwd = StringUtils.EMPTY;
try {
decreptedexternalAppPwd = CipherUtil.decryptPKC(password,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e);
}
@@ -353,8 +355,8 @@ public class SessionCommunication {
encriptedPwdDB = decreptedexternalAppPwd;
}else{
- appUserName = app.username;
- encriptedPwdDB = app.appPassword;
+ appUserName = app.getAppBasicAuthUsername();
+ encriptedPwdDB = app.getAppBasicAuthPassword();
}
headersMap.put("username", appUserName);
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java
index a60266cf..2b8d6d43 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java
@@ -132,19 +132,19 @@ public class TimeoutHandler extends QuartzJobBean {
Map<Long, Map<String, TimeoutVO>> appSessionTimeOutMap = new Hashtable<Long, Map<String, TimeoutVO>>();
// determine the Max TimeOut Time for each of the managed sessions
for (OnboardingApp app : appList) {
- if (app.restUrl == null) {
- logger.info(EELFLoggerDelegate.debugLogger, "Session Management: null restUrl, not fetching from app " + app.name);
+ if (app.getRestUrl() == null) {
+ logger.info(EELFLoggerDelegate.debugLogger, "Session Management: null restUrl, not fetching from app " + app.getAppName());
continue;
}
- logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.name + " at URL " + app.restUrl);
+ logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.getAppName() + " at URL " + app.getRestUrl());
String jsonSessionStr = fetchAppSessions(app);
- logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.name + " returned " + jsonSessionStr);
+ logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.getAppName() + " returned " + jsonSessionStr);
if (jsonSessionStr == null || jsonSessionStr.isEmpty())
continue;
try {
Map<String, TimeoutVO> sessionTimeoutMap = mapper.readValue(jsonSessionStr, typeRef);
- appSessionTimeOutMap.put(app.id, sessionTimeoutMap);
+ appSessionTimeOutMap.put(app.getId(), sessionTimeoutMap);
for (String portalJSessionId : sessionTimeoutMap.keySet()) {
final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId);
final TimeoutVO compareTimeoutVO = sessionTimeoutMap.get(portalJSessionId);
@@ -168,12 +168,12 @@ public class TimeoutHandler extends QuartzJobBean {
// post the updated session timeouts back to the Apps
for (OnboardingApp app : appList) {
- if (app.restUrl == null) {
- logger.warn(EELFLoggerDelegate.errorLogger, "Session Management: null restUrl, not posting back to app " + app.name);
+ if (app.getRestUrl() == null) {
+ logger.warn(EELFLoggerDelegate.errorLogger, "Session Management: null restUrl, not posting back to app " + app.getAppName());
continue;
}
- Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.id);
+ Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.getId());
if (sessionTimeoutMap == null || sessionTimeoutMap.isEmpty())
continue;
@@ -184,7 +184,7 @@ public class TimeoutHandler extends QuartzJobBean {
if (maxTimeoutVO == null || setTimeoutVO == null) {
String message = String.format(
"Session Management: Failed to update the session timeouts for the app: %s and the sessionId: %s.",
- app.name, portalJSessionId);
+ app.getAppName(), portalJSessionId);
logger.warn(EELFLoggerDelegate.errorLogger, message);
continue;
}
@@ -194,7 +194,7 @@ public class TimeoutHandler extends QuartzJobBean {
continue;
}
}
- logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.restUrl);
+ logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.getRestUrl());
String sessionTimeoutMapStr = "";
try {
sessionTimeoutMapStr = mapper.writeValueAsString(sessionTimeoutMap);