public class UserUtil
extends java.lang.Object
Constructor and Description |
---|
UserUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areValidUsers(java.lang.String ticket,
java.lang.String[] userLoginNames)
Returns true if all the parameterized userLoginNames correspond to valid users, false otherwise.
|
static java.lang.String |
getCurrentUserDisplayName(java.lang.String ticket)
Convenience method that returns the currently logged in user's Display Name.
|
static java.lang.String |
getCurrentUserLoginName(java.lang.String ticket)
Convenience method that returns the currently logged in user's userLoginName.
|
static java.lang.String |
getDisplayNameFromLoginName(java.lang.String ticket,
java.lang.String loginName,
boolean strictMode)
Gets the display name of a user from a provided login name.
|
static java.lang.String |
getLabelName(java.lang.String ticket,
java.lang.String userLoginName)
Get the "Label Name" for the given user.
|
static java.lang.String |
getLabelName(UserBean userBean) |
static java.lang.String |
getLoginNameFromDisplayName(java.lang.String ticket,
java.lang.String loginName,
boolean strictMode)
Gets the username of a user from a provided display name.
|
static java.util.List<OCAuthority> |
getOCAuthorityUser(java.lang.String ticket,
java.lang.String loginName,
boolean strictMode)
This method is called by getDisplayNameFromLoginName/getLoginNameFromDisplayName to return a List
|
public static java.lang.String getCurrentUserLoginName(java.lang.String ticket)
ticket
- public static java.lang.String getCurrentUserDisplayName(java.lang.String ticket)
ticket
- A valid OC Ticketpublic static java.lang.String getLabelName(java.lang.String ticket, java.lang.String userLoginName)
ticket
- OC ticketuserLoginName
- the user login name to look forpublic static java.lang.String getLabelName(UserBean userBean)
userBean
- getLabelName(String, String)
public static java.util.List<OCAuthority> getOCAuthorityUser(java.lang.String ticket, java.lang.String loginName, boolean strictMode) throws OCRuntimeException
ticket
- A valid OC ticket to use.loginName
- The loginName of the user to fetch the displayName for.strictMode
- True to throw an exception if the getUser call fails, false otherwise.OCRuntimeException
- If an error occurs finding a user with the provided loginName parameter and the strictMode parameter is set to true.public static java.lang.String getDisplayNameFromLoginName(java.lang.String ticket, java.lang.String loginName, boolean strictMode)
ticket
- A valid OC ticket to use.loginName
- The loginName of the user to fetch the displayName for.strictMode
- True to throw an exception if the getUser call fails, false otherwise.OCRuntimeException
- If an error occurs finding a user with the provided loginName parameter and the strictMode parameter is set to true.public static java.lang.String getLoginNameFromDisplayName(java.lang.String ticket, java.lang.String loginName, boolean strictMode)
ticket
- A valid OC ticket to use.loginName
- The loginName of the user to fetch the displayName for.strictMode
- True to throw an exception if the getUser call fails, false otherwise.OCRuntimeException
- If an error occurs finding a user with the provided loginName parameter and the strictMode parameter is set to true.public static boolean areValidUsers(java.lang.String ticket, java.lang.String[] userLoginNames)
ticket
- userLoginNames
-