package jetbrains.buildServer.vcsUsersSync; import jetbrains.buildServer.serverSide.TeamCityProperties; import jetbrains.buildServer.serverSide.auth.Role; import org.jetbrains.annotations.Nullable; /** * @author Yegor.Yarko * Date: 25.09.12 */ public class VcsUserSynchronizerOptions { private boolean myCreateUsers; private UserSynchronizerRolesMode myAddRolesMode; private String myRoleId; public boolean isCreateUsers() { return TeamCityProperties.getBoolean("vcsUsersSync.createUsers"); } @Nullable public UserSynchronizerRolesMode getAddRolesMode() { return getEnumFromString(TeamCityProperties.getProperty("vcsUsersSync.rolesMode")); } private static UserSynchronizerRolesMode getEnumFromString(String string) { if (string != null) { try { return UserSynchronizerRolesMode.valueOf(string.trim().toUpperCase()); } catch (IllegalArgumentException ex) { return null; } } return null; } public String getRoleId() { return TeamCityProperties.getProperty("vcsUsersSync.roleId"); } public String getEmailDomain() { return TeamCityProperties.getProperty("vcsUsersSync.emailDomain"); } }