private SUser getUser(String userName) throws SUserNotFoundException { try { return identityService.getUserByUserName(userName); } catch (SUserNotFoundException e) { debugLog("Unable to find user with username " + userName + " in database."); throw e; } }
@Override public void execute() throws SBonitaException { if (userName != null) { sUser = identityService.getUserByUserName(userName); } else { sUser = identityService.getUser(userId); } }
private SUser getUser(String userName) throws SUserNotFoundException { try { return identityService.getUserByUserName(userName); } catch (SUserNotFoundException e) { debugLog("Unable to find user with username " + userName + " in database."); throw e; } }
@Override public void execute() throws SBonitaException { if (userName != null) { sUser = identityService.getUserByUserName(userName); } else { sUser = identityService.getUser(userId); } }
public Map<String, SUser> importUsers(final List<ExportedUser> usersToImport) throws SBonitaException { final Map<String, SUser> userNameToSUsers = new HashMap<>((int) Math.min(Integer.MAX_VALUE, identityService.getNumberOfUsers())); for (final ExportedUser userToImport : usersToImport) { SUser sUser; if (hasUserWithUserName(userToImport.getUserName())) { sUser = identityService.getUserByUserName(userToImport.getUserName()); strategy.foundExistingUser(sUser, userToImport); } else { sUser = addAllUserInfo(userToImport); } userNameToSUsers.put(sUser.getUserName(), sUser); } return userNameToSUsers; }
public Map<String, SUser> importUsers(final List<ExportedUser> usersToImport) throws SBonitaException { final Map<String, SUser> userNameToSUsers = new HashMap<>((int) Math.min(Integer.MAX_VALUE, identityService.getNumberOfUsers())); for (final ExportedUser userToImport : usersToImport) { SUser sUser; if (hasUserWithUserName(userToImport.getUserName())) { sUser = identityService.getUserByUserName(userToImport.getUserName()); strategy.foundExistingUser(sUser, userToImport); } else { sUser = addAllUserInfo(userToImport); } userNameToSUsers.put(sUser.getUserName(), sUser); } return userNameToSUsers; }
/** * @see org.bonitasoft.engine.authentication.GenericAuthenticationService#checkUserCredentials(java.util.Map) */ @Override public String checkUserCredentials(Map<String, Serializable> credentials) { final String methodName = "checkUserCredentials"; try { final String password = String.valueOf(credentials.get(AuthenticationConstants.BASIC_PASSWORD)); final String userName = String.valueOf(credentials.get(AuthenticationConstants.BASIC_USERNAME)); if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogBeforeMethod(this.getClass(), methodName)); } final SUser user = identityService.getUserByUserName(userName); if (identityService.checkCredentials(user, password)) { if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogAfterMethod(this.getClass(), methodName)); } return userName; } if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogAfterMethod(this.getClass(), methodName)); } } catch (final SUserNotFoundException sunfe) { if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogOnExceptionMethod(this.getClass(), methodName, sunfe)); } } return null; }
/** * @see org.bonitasoft.engine.authentication.GenericAuthenticationService#checkUserCredentials(java.util.Map) */ @Override public String checkUserCredentials(Map<String, Serializable> credentials) { final String methodName = "checkUserCredentials"; try { final String password = String.valueOf(credentials.get(AuthenticationConstants.BASIC_PASSWORD)); final String userName = String.valueOf(credentials.get(AuthenticationConstants.BASIC_USERNAME)); if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogBeforeMethod(this.getClass(), methodName)); } final SUser user = identityService.getUserByUserName(userName); if (identityService.checkCredentials(user, password)) { if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogAfterMethod(this.getClass(), methodName)); } return userName; } if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogAfterMethod(this.getClass(), methodName)); } } catch (final SUserNotFoundException sunfe) { if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) { logger.log(this.getClass(), TechnicalLogSeverity.TRACE, LogUtil.getLogOnExceptionMethod(this.getClass(), methodName, sunfe)); } } return null; }
@Override public void execute() throws SBonitaException { try { long id = userId; if (id == -1) { id = getIdentityService().getUserByUserName(userName).getId(); } deleteUserMembershipsByUser(id); deleteActorMembersOfUser(id); deleteProfileMembersOfUser(id); getIdentityService().deleteUser(id); } catch (SUserNotFoundException notFound) { // not found, don't do anything specific } }
@Override public void execute() throws SBonitaException { try { long id = userId; if (id == -1) { id = getIdentityService().getUserByUserName(userName).getId(); } deleteUserMembershipsByUser(id); deleteActorMembersOfUser(id); deleteProfileMembersOfUser(id); getIdentityService().deleteUser(id); } catch (SUserNotFoundException notFound) { // not found, don't do anything specific } }
SUser user = null; try { user = identityService.getUserByUserName(userName); } catch (final SUserNotFoundException e) { errors.add(new ImportError(userName, Type.USER));
SUser user = null; try { user = identityService.getUserByUserName(userName); } catch (final SUserNotFoundException e) { errors.add(new ImportError(userName, Type.USER));
final Set<String> userNames = actor.getUsers(); for (final String userName : userNames) { final SUser user = identityService.getUserByUserName(userName); checkAlreadyExistingUserMapping(actorId, user.getId()); actorMappingService.addUserToActor(actorId, user.getId());
final Set<String> userNames = actor.getUsers(); for (final String userName : userNames) { final SUser user = identityService.getUserByUserName(userName); checkAlreadyExistingUserMapping(actorId, user.getId()); actorMappingService.addUserToActor(actorId, user.getId());