From 7840a43cacd88e5b0f4158ebf3ac1f9e04b1cc32 Mon Sep 17 00:00:00 2001 From: felmer <franz-josef.elmer@id.ethz.ch> Date: Mon, 16 Sep 2019 12:33:31 +0200 Subject: [PATCH] SSDM-8734: formating --- .../task/UserManagementMaintenanceTask.java | 6 +++--- .../generic/server/task/UserManager.java | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManagementMaintenanceTask.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManagementMaintenanceTask.java index f2a4ae2bd2d..cc7c2128884 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManagementMaintenanceTask.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManagementMaintenanceTask.java @@ -142,7 +142,7 @@ public class UserManagementMaintenanceTask extends AbstractMaintenanceTask { operationLog.error("Empty ldapGroupKey for group '" + key + "'. Task aborted."); return false; - + } List<Principal> principals = getUsersOfGroup(ldapGroupKey); if (group.isEnabled() && principals.isEmpty()) @@ -212,8 +212,8 @@ public class UserManagementMaintenanceTask extends AbstractMaintenanceTask protected UserManager createUserManager(Log4jSimpleLogger logger, UserManagerReport report) { IAuthenticationService authenticationService = (IAuthenticationService) CommonServiceProvider.tryToGetBean("authentication-service"); - UserManager userManager = new UserManager(authenticationService, CommonServiceProvider.getApplicationServerApi(), - shareIdsMappingFile, logger, report); + UserManager userManager = new UserManager(authenticationService, CommonServiceProvider.getApplicationServerApi(), + shareIdsMappingFile, logger, report); userManager.setDeactivateUnknwonUsers(deactivateUnknownUsers); return userManager; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java index b436da7ca96..cb30530e07a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java @@ -111,7 +111,7 @@ public class UserManager private final ISimpleLogger logger; - private final UserManagerReport report; + private final UserManagerReport report; private final Map<String, UserInfo> userInfosByUserId = new TreeMap<>(); @@ -130,12 +130,11 @@ public class UserManager private Map<String, HomeSpaceRequest> requestedHomeSpaceByUserId = new TreeMap<>(); private File shareIdsMappingFileOrNull; - + private List<MappingAttributes> mappingAttributesList = new ArrayList<>(); private boolean deactivateUnknownUsers; - public UserManager(IAuthenticationService authenticationService, IApplicationServerInternalApi service, File shareIdsMappingFileOrNull, ISimpleLogger logger, UserManagerReport report) { @@ -186,12 +185,12 @@ public class UserManager return new ConfigurationFailureException("Identifier template '" + identifierTemplate + "' is invalid" + (StringUtils.isBlank(message) ? ". " : " (reason: " + message + "). ") + "Template schema: " + templateSchema); } - + public void setDeactivateUnknwonUsers(boolean deactivateUnknownUsers) { this.deactivateUnknownUsers = deactivateUnknownUsers; } - + public void addGroup(UserGroup group, Map<String, Principal> principalsByUserId) { String groupCode = group.getKey().toUpperCase(); @@ -213,7 +212,7 @@ public class UserManager userInfo.addGroupInfo(new GroupInfo(groupCode, admins.contains(userId))); } } - logger.log(LogLevel.INFO, principalsByUserId.size() + " users for " + (group.isEnabled() ? "": "disabled ") + "group " + groupCode); + logger.log(LogLevel.INFO, principalsByUserId.size() + " users for " + (group.isEnabled() ? "" : "disabled ") + "group " + groupCode); } public void manage() @@ -244,7 +243,7 @@ public class UserManager logger.log(LogLevel.ERROR, "", e); } } - + private void updateMappingFile() { if (shareIdsMappingFileOrNull != null && mappingAttributesList.isEmpty() == false) @@ -257,7 +256,7 @@ public class UserManager { printWriter = new PrintWriter(newFile); printWriter.println("Identifier\tShare IDs\tArchive Folder"); - for (MappingAttributes attributes: mappingAttributesList) + for (MappingAttributes attributes : mappingAttributesList) { CommaSeparatedListBuilder builder = new CommaSeparatedListBuilder(); List<String> shareIds = attributes.getShareIds(); @@ -576,7 +575,7 @@ public class UserManager createAuthorizationGroup(context, adminGroupCode); createCommonSpaces(context, groupCode); - + manageUsers(context, groupCode, groupUsers); } @@ -948,6 +947,7 @@ public class UserManager private static final class MappingAttributes { private String groupCode; + private List<String> shareIds; public MappingAttributes(String groupCode, List<String> shareIds) -- GitLab