public final class UserManagementHelper extends Object
Modifier and Type | Method and Description |
---|---|
static long |
getCountLimit()
Gets the user limit.
|
static int |
getCurrentOffsetOfEffectiveUserTimeZone()
Returns the offset in milliseconds to add to UTC to get the time for the current user
respecting the effective user time zone and daylight savings.
|
static int |
getCurrentUtcOffsetOfEffectiveUserTimeZone()
Returns the offset in milliseconds to add to UTC to get the current time for the current user
respecting the effective user time zone and daylight savings.
|
static DateFormat |
getDateFormat(Long userId,
Locale locale)
Get the date formatter for the given locale which can be used to create a readable localized
date-time string.
|
static TimeZone |
getEffectiveUserTimeZone()
Gets the effective time zone for the currently logged in user.
If no time zone exists for the user, this method returns the client time zone as fall back. If no time zone exists for the client, this method returns the system time zone as fall back. |
static TimeZone |
getEffectiveUserTimeZone(Long userId)
Gets the effective time zone for the user.
If no time zone exists for the user, this method returns the client time zone as fall back. If no time zone exists for the client, this method returns the system time zone as fall back. |
static TimeZone |
getEffectiveUserTimeZone(Long userId,
TimeZone fallback)
Gets the effective time zone for the user.
If no time zone exists for the user, this method returns the client time zone as fall back. If no time zone exists for the client, this method returns the defined time zone as fall back. |
static TimeZone |
getEffectiveUserTimeZone(TimeZone fallback)
Gets the effective time zone for the currently logged in user.
If no time zone exists for the user, this method returns the client time zone as fall back. If no time zone exists for the client, this method returns the defined time zone as fall back. |
static Locale |
getFallbackLocale() |
static String |
getLegalAliasFromEmailAddress(String address)
Converts an email address, only the local part of it, into a valid user alias.
|
static Map<Locale,Collection<User>> |
getUserByLocale(Collection<User> users)
Groups a collection of users by their localization settings.
|
static Map<Locale,Collection<User>> |
getUserByLocale(Collection<User> users,
Collection<User> usersToSkip)
Groups a collection of users by their localization settings.
|
static boolean |
isAutomaticUserActivation()
Get the Value of ConfigurationPropertyConstants.Client.AUTOMATIC_USER_ACTIVATION for better
code reading.
|
static boolean |
isSystemUser(User user) |
public static long getCountLimit()
public static int getCurrentOffsetOfEffectiveUserTimeZone()
Returns the offset in milliseconds to add to UTC to get the time for the current user respecting the effective user time zone and daylight savings.
Note: The offset is for the servers time.public static int getCurrentUtcOffsetOfEffectiveUserTimeZone()
public static DateFormat getDateFormat(Long userId, Locale locale)
userId
- the user idlocale
- the localepublic static TimeZone getEffectiveUserTimeZone()
public static TimeZone getEffectiveUserTimeZone(Long userId)
userId
- the id of a userpublic static TimeZone getEffectiveUserTimeZone(Long userId, TimeZone fallback)
userId
- the id of a userfallback
- the defined fall backpublic static TimeZone getEffectiveUserTimeZone(TimeZone fallback)
fallback
- the defined fall backpublic static Locale getFallbackLocale()
public static String getLegalAliasFromEmailAddress(String address)
address
- the email address to convertpublic static Map<Locale,Collection<User>> getUserByLocale(Collection<User> users)
users
- the userspublic static Map<Locale,Collection<User>> getUserByLocale(Collection<User> users, Collection<User> usersToSkip)
users
- the user collectionusersToSkip
- a subset of the users collection containing those users that should be included in
the result. Can be null.public static boolean isAutomaticUserActivation()
public static boolean isSystemUser(User user)
user
- the user to checkCopyright © 2019 Communote team. All rights reserved.