2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalapp.portal.controller;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.Collections;
25 import java.util.Comparator;
26 import java.util.List;
28 import javax.servlet.http.HttpServletRequest;
29 import javax.servlet.http.HttpServletResponse;
31 import org.apache.cxf.transport.http.HTTPException;
32 import org.openecomp.portalapp.controller.EPRestrictedBaseController;
33 import org.openecomp.portalapp.portal.domain.EPRole;
34 import org.openecomp.portalapp.portal.domain.EPUser;
35 import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
36 import org.openecomp.portalapp.portal.domain.EcompAuditLog;
37 import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
38 import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
39 import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
40 import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
41 import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
42 import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
43 import org.openecomp.portalapp.portal.service.AdminRolesService;
44 import org.openecomp.portalapp.portal.service.ApplicationsRestClientService;
45 import org.openecomp.portalapp.portal.service.SearchService;
46 import org.openecomp.portalapp.portal.service.UserRolesService;
47 import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
48 import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
49 import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
50 import org.openecomp.portalapp.portal.transport.FieldsValidator;
51 import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
52 import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
53 import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
54 import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
55 import org.openecomp.portalapp.portal.utils.PortalConstants;
56 import org.openecomp.portalapp.util.EPUserUtils;
57 import org.openecomp.portalsdk.core.domain.AuditLog;
58 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
59 import org.openecomp.portalsdk.core.restful.domain.EcompRole;
60 import org.openecomp.portalsdk.core.service.AuditService;
61 import org.openecomp.portalsdk.core.util.SystemProperties;
63 import org.springframework.beans.factory.annotation.Autowired;
64 import org.springframework.context.annotation.EnableAspectJAutoProxy;
65 import org.springframework.web.bind.annotation.PathVariable;
66 import org.springframework.web.bind.annotation.RequestBody;
67 import org.springframework.web.bind.annotation.RequestMapping;
68 import org.springframework.web.bind.annotation.RequestMethod;
69 import org.springframework.web.bind.annotation.RequestParam;
70 import org.springframework.web.bind.annotation.RestController;
73 @org.springframework.context.annotation.Configuration
74 @EnableAspectJAutoProxy
76 public class UserRolesController extends EPRestrictedBaseController {
78 private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesController.class);
81 private SearchService searchService;
83 private AdminRolesService adminRolesService;
84 private @Autowired UserRolesService userRolesService;
86 private ApplicationsRestClientService applicationsRestClientService;
88 private AuditService auditService;
90 private static final String FAILURE = "failure";
93 * RESTful service method to fetch users in the WebPhone external service
100 * HttpServletResponse
101 * @return array of found users as json
103 @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json")
104 public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString,
105 HttpServletResponse response) {
106 EPUser user = EPUserUtils.getUserSession(request);
107 String searchResult = null;
108 if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
109 EcompPortalUtils.setBadPermissions(user, response, "getPhoneBookSearchResult");
111 searchString = searchString.trim();
112 if (searchString.length() > 2) {
113 searchResult = searchService.searchUsersInPhoneBook(searchString);
115 logger.info(EELFLoggerDelegate.errorLogger,
116 "getPhoneBookSearchResult - too short search string: " + searchString);
119 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/queryUsers", "result =", searchResult);
125 * RESTful service method to fetch applications where user is admin
132 * HttpServletResponse
133 * @return for GET: array of all applications with boolean
134 * isAdmin=true/false for each application
136 @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
137 RequestMethod.GET }, produces = "application/json")
138 public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request,
139 @RequestParam("user") String orgUserId, HttpServletResponse response) {
141 EPUser user = EPUserUtils.getUserSession(request);
142 AppsListWithAdminRole result = null;
143 if (!adminRolesService.isSuperAdmin(user)) {
144 EcompPortalUtils.setBadPermissions(user, response, "getAppsWithAdminRoleStateForUser");
146 if (EcompPortalUtils.legitimateUserId(orgUserId)) {
147 result = adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId);
149 logger.info(EELFLoggerDelegate.errorLogger,
150 "getAppsWithAdminRoleStateForUser - parms error, no Organization User ID");
151 response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
155 StringBuilder adminAppRoles = new StringBuilder();
156 if (result != null && result.appsRoles.size() >= 1) {
157 adminAppRoles.append("User '" + result.orgUserId + "' has admin role to the apps = {");
158 for (AppNameIdIsAdmin adminAppRole : result.appsRoles) {
159 if (adminAppRole.isAdmin) {
160 adminAppRoles.append(adminAppRole.appName + ", ");
163 adminAppRoles.append("}.");
165 adminAppRoles.append("User '" + result.orgUserId + "' has no Apps with Admin Role.");
167 logger.info(EELFLoggerDelegate.errorLogger, adminAppRoles.toString());
169 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "get result =", result);
178 * @param newAppsListWithAdminRoles
181 * HttpServletResponse
182 * @return FieldsValidator
184 @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
185 RequestMethod.PUT }, produces = "application/json")
186 public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request,
187 @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) {
189 // newAppsListWithAdminRoles.appsRoles
190 FieldsValidator fieldsValidator = new FieldsValidator();
191 StringBuilder newAppRoles = new StringBuilder();
192 if (newAppsListWithAdminRoles != null && newAppsListWithAdminRoles.appsRoles.size() >= 1) {
193 newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has admin role to the apps = { ");
194 for (AppNameIdIsAdmin adminAppRole : newAppsListWithAdminRoles.appsRoles) {
195 if (adminAppRole.isAdmin) {
196 newAppRoles.append(adminAppRole.appName + " ,");
199 newAppRoles.deleteCharAt(newAppRoles.length() - 1);
200 newAppRoles.append("}.");
202 newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has no Apps with Admin Role.");
204 logger.info(EELFLoggerDelegate.errorLogger, newAppRoles.toString());
206 EPUser user = EPUserUtils.getUserSession(request);
207 boolean changesApplied = false;
209 if (!adminRolesService.isSuperAdmin(user)) {
210 EcompPortalUtils.setBadPermissions(user, response, "putAppsWithAdminRoleStateForUser");
212 changesApplied = adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles);
213 AuditLog auditLog = new AuditLog();
214 auditLog.setUserId(user.getId());
215 auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN);
216 auditLog.setAffectedRecordId(newAppsListWithAdminRoles.orgUserId);
217 auditLog.setComments(EcompPortalUtils.truncateString(newAppRoles.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
218 auditService.logActivity(auditLog, null);
220 MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
221 MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
222 EcompPortalUtils.calculateDateTimeDifferenceForLog(
223 MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
224 MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
225 logger.info(EELFLoggerDelegate.auditLogger,
226 EPLogUtil.formatAuditLogMessage("UserRolesController.putAppsWithAdminRoleStateForUser",
227 EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN, user.getOrgUserId(),
228 newAppsListWithAdminRoles.orgUserId, newAppRoles.toString()));
229 MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
230 MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
231 MDC.remove(SystemProperties.MDC_TIMER);
233 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "put result =", changesApplied);
235 return fieldsValidator;
239 * It returns a list of user app roles for single app
244 * HttpServletResponse
249 * @param extRequestValue
250 * set to false if request is from users page otherwise true
251 * @return List<RoleInAppForUser>
253 @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
254 RequestMethod.GET }, produces = "application/json")
255 public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId,
256 @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue,
257 HttpServletResponse response) {
258 EPUser user = EPUserUtils.getUserSession(request);
259 List<RoleInAppForUser> result = null;
260 String feErrorString = "";
261 if (!adminRolesService.isAccountAdmin(user)) {
262 EcompPortalUtils.setBadPermissions(user, response, "getAppRolesForUser");
263 feErrorString = EcompPortalUtils.getFEErrorString(true, response.getStatus());
265 if (EcompPortalUtils.legitimateUserId(orgUserId)) {
266 result = userRolesService.getAppRolesForUser(appid, orgUserId, extRequestValue);
267 int responseCode = EcompPortalUtils.getExternalAppResponseCode();
268 if (responseCode != 0 && responseCode != 200) {
270 response.setStatus(responseCode);
271 feErrorString = EcompPortalUtils.getFEErrorString(false, responseCode);
272 } else if (result == null) {
273 // If the result is null, there was an internal ecomp error
274 // in the service call.
275 response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
276 feErrorString = EcompPortalUtils.getFEErrorString(true,
277 HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
280 logger.info(EELFLoggerDelegate.errorLogger, "getAppRolesForUser - no Organization User ID");
281 response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
282 feErrorString = EcompPortalUtils.getFEErrorString(true, HttpServletResponse.SC_BAD_REQUEST);
286 StringBuilder sbUserApps = new StringBuilder();
287 if (result != null && result.size() >= 1) {
288 sbUserApps.append("User '" + orgUserId + "' has Roles={");
289 for (RoleInAppForUser appRole : result) {
290 if (appRole.isApplied) {
291 sbUserApps.append(appRole.roleName + ", ");
294 sbUserApps.append("} assigned to the appId '" + appid + "'.");
296 // Not sure creating an empty object will make any difference
297 // but would like to give it a shot for defect #DE221057
298 if (result == null) {
299 result = new ArrayList<RoleInAppForUser>();
301 sbUserApps.append("User '" + orgUserId + "' and appid " + appid + " has no roles");
303 logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString());
305 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "get result =", result);
306 if (feErrorString != "") {
307 logger.debug(EELFLoggerDelegate.debugLogger, "LR: FEErrorString to header: " + feErrorString);
309 response.addHeader("FEErrorString", feErrorString);
310 response.addHeader("Access-Control-Expose-Headers", "FEErrorString");
315 @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
316 RequestMethod.PUT }, produces = "application/json")
317 public FieldsValidator putAppWithUserRoleStateForUser(HttpServletRequest request,
318 @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
319 FieldsValidator fieldsValidator = new FieldsValidator();
320 StringBuilder sbUserApps = new StringBuilder();
321 if (newAppRolesForUser != null) {
322 sbUserApps.append("User '" + newAppRolesForUser.orgUserId);
323 if (newAppRolesForUser.appRoles != null && newAppRolesForUser.appRoles.size() >= 1) {
324 sbUserApps.append("' has roles = { ");
325 for (RoleInAppForUser appRole : newAppRolesForUser.appRoles) {
326 if (appRole.isApplied) {
327 sbUserApps.append(appRole.roleName + " ,");
330 sbUserApps.deleteCharAt(sbUserApps.length() - 1);
331 sbUserApps.append("} assigned for the app " + newAppRolesForUser.appId);
333 sbUserApps.append("' has no roles assigned for app " + newAppRolesForUser.appId);
336 logger.info(EELFLoggerDelegate.applicationLogger, "putAppWithUserRoleStateForUser: {}", sbUserApps.toString());
338 EPUser user = EPUserUtils.getUserSession(request);
339 boolean changesApplied = false;
340 if (!adminRolesService.isAccountAdmin(user)) {
341 EcompPortalUtils.setBadPermissions(user, response, "putAppWithUserRoleStateForUser");
343 changesApplied = userRolesService.setAppWithUserRoleStateForUser(user, newAppRolesForUser);
344 if (changesApplied) {
345 logger.info(EELFLoggerDelegate.applicationLogger,
346 "putAppWithUserRoleStateForUser: succeeded for app {}, user {}", newAppRolesForUser.appId,
347 newAppRolesForUser.orgUserId);
349 MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
350 AuditLog auditLog = new AuditLog();
351 auditLog.setUserId(user.getId());
352 auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_USER);
353 auditLog.setAffectedRecordId(newAppRolesForUser.orgUserId);
354 auditLog.setComments(EcompPortalUtils.truncateString(sbUserApps.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
355 auditService.logActivity(auditLog, null);
357 MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
358 EcompPortalUtils.calculateDateTimeDifferenceForLog(
359 MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
360 MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
361 logger.info(EELFLoggerDelegate.auditLogger,
362 EPLogUtil.formatAuditLogMessage("UserRolesController.putAppWithUserRoleStateForUser",
363 EcompAuditLog.CD_ACTIVITY_UPDATE_USER, user.getOrgUserId(),
364 newAppRolesForUser.orgUserId, sbUserApps.toString()));
365 MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
366 MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
367 MDC.remove(SystemProperties.MDC_TIMER);
369 logger.error(EELFLoggerDelegate.errorLogger,
370 "putAppWithUserRoleStateForUser: failed for app {}, user {}", newAppRolesForUser.appId,
371 newAppRolesForUser.orgUserId);
375 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "put result =", changesApplied);
376 return fieldsValidator;
379 @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = {
380 RequestMethod.GET }, produces = "application/json")
381 public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request,
382 HttpServletResponse response) {
384 String updateRemoteUserFlag = FAILURE;
386 // saveNewUser = userService.saveNewUser(newUser);
387 String orgUserId = request.getParameter("loginId");
388 Long appId = Long.parseLong(request.getParameter("appId"));
389 userRolesService.updateRemoteUserProfile(orgUserId, appId);
391 } catch (Exception e) {
392 return new PortalRestResponse<String>(PortalRestStatusEnum.OK, updateRemoteUserFlag, e.getMessage());
394 return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, updateRemoteUserFlag, "");
398 @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = {
399 RequestMethod.GET }, produces = "application/json")
400 public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request,
401 @PathVariable("appId") Long appId) throws HTTPException {
403 logger.debug(EELFLoggerDelegate.debugLogger, "/portalApi/app/{}/users was invoked", appId);
404 List<UserApplicationRoles> appUsers = userRolesService.getUsersFromAppEndpoint(appId);
406 } catch (Exception e) {
407 logger.error(EELFLoggerDelegate.errorLogger,
408 "Exception occurred while performing UserRolesController.getUsersFromAppEndpoint. Details: "
409 + EcompPortalUtils.getStackTrace(e));
410 return new ArrayList<UserApplicationRoles>();
414 @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = {
415 RequestMethod.GET }, produces = "application/json")
416 public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId)
417 throws HTTPException {
418 EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
419 List<EcompRole> rolesList = Arrays.asList(appRoles);
420 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/roles", "response for appId=" + appId,
426 @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = {
427 RequestMethod.GET }, produces = "application/json")
428 public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId)
429 throws HTTPException {
430 List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId);
431 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/admin/import/app/{appId}/roles",
432 "response for appId=" + appId, rolesList);
437 @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = {
438 RequestMethod.GET }, produces = "application/json")
439 public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
440 @PathVariable("orgUserId") String orgUserId) throws Exception {
441 if (!EcompPortalUtils.legitimateUserId(orgUserId)) {
442 String msg = "Error /user/<user>/roles not legitimate orgUserId = " + orgUserId;
443 logger.error(EELFLoggerDelegate.errorLogger, msg);
444 throw new Exception(msg);
446 EcompRole[] roles = applicationsRestClientService.get(EcompRole[].class, appId,
447 String.format("/user/%s/roles", orgUserId));
448 if (roles.length != 1) {
449 String msg = "Error /user/<user>/roles returned array. expected size 1 recieved size = " + roles.length;
450 logger.error(EELFLoggerDelegate.errorLogger, msg);
451 throw new Exception(msg);
454 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/user/{orgUserId}/roles",
455 "response for appId='" + appId + "' and orgUserId='" + orgUserId + "'", roles[0]);
459 @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = {
460 RequestMethod.PUT }, produces = "application/json")
461 public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request,
462 @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
463 FieldsValidator fieldsValidator = null;
466 EPUser user = EPUserUtils.getUserSession(request);
467 fieldsValidator = userRolesService.putUserAppRolesRequest(newAppRolesForUser, user);
468 response.setStatus(fieldsValidator.httpStatusCode.intValue());
470 } catch (Exception e) {
471 logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleRequest failed", e);
474 // return fieldsValidator;
475 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppRoles", "PUT result =",
476 response.getStatus());
477 return fieldsValidator;
480 @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = {
481 RequestMethod.GET }, produces = "application/json")
482 public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request,
483 @RequestParam("appName") String appName) {
484 EPUser user = EPUserUtils.getUserSession(request);
485 List<EPUserAppCatalogRoles> userAppRoleList = null;
487 userAppRoleList = userRolesService.getUserAppCatalogRoles(user, appName);
488 } catch (Exception e) {
489 logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
492 Collections.sort(userAppRoleList, getUserAppCatalogRolesComparator);
493 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =", userAppRoleList);
495 return userAppRoleList;
499 private Comparator<EPUserAppCatalogRoles> getUserAppCatalogRolesComparator = new Comparator<EPUserAppCatalogRoles>() {
500 public int compare(EPUserAppCatalogRoles o1, EPUserAppCatalogRoles o2) {
501 return o1.getRolename().compareTo(o2.getRolename());
505 @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET, produces = "application/json")
506 public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) {
507 ExternalSystemAccess result = null;
509 result = userRolesService.getExternalRequestAccess();
510 EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/externalRequestAccessSystem", "GET result =",
512 } catch (Exception e) {
513 logger.error(EELFLoggerDelegate.errorLogger, "readExternalRequestAccess failed: " + e.getMessage());