public interface UserDirectoryService
Important things to note:
Modifier and Type | Method and Description |
---|---|
void |
addMembers(GroupName groupName,
java.util.List<PrincipalName> memberNames)
Adds the given principals (users or groups) to the given group.
|
GroupPrincipal |
createGroup(java.lang.String groupname,
java.lang.String displayName,
java.lang.String email)
Creates a new group.
|
UserPrincipal |
createUser(java.lang.String username,
java.lang.String domainName,
java.lang.String displayName,
java.lang.String email,
java.lang.String password)
Creates a new user.
|
java.util.List<GroupPrincipal> |
getAllGroups(PrincipalName principalName)
Returns the groups (immediate or otherwise) that the given principal (user or group) is a member of.
|
GroupPrincipal |
getGroupById(Guid id)
Returns a GroupPrincipal object representing the group with the given ID.
|
GroupPrincipal |
getGroupByName(GroupName groupName)
Returns the group principal with the given name (consisting of both a name component and a domain).
|
java.util.List<GroupPrincipal> |
getImmediateGroups(PrincipalName principalName)
Returns the immediate groups that the given principal (user or group) is a member of.
|
java.util.List<SpotfirePrincipal> |
getMembers(GroupName groupName)
Returns the immediate members of the given group.
|
UserPrincipal |
getUserById(Guid id)
Returns the user with the given ID.
|
UserPrincipal |
getUserByName(UserName userName)
Returns the user principal with the given name (consisting of both a name component and a domain).
|
boolean |
isMember(GroupName groupName,
PrincipalName principalName)
Returns true if the given principal (user or group) is a member (immediate or otherwise) of the given group.
|
void |
removeMembers(GroupName groupName,
java.util.List<PrincipalName> memberNames)
Removes the given principals (users or groups) from the given group.
|
void |
removePrincipals(java.util.List<PrincipalName> principalNames)
Removes the given principals (users and groups).
|
java.util.List<GroupPrincipal> |
searchGroups(java.lang.String searchExpression,
int maxResults)
Returns all groups, up to the specified upper limit, with names that matches the given search expression.
|
java.util.List<UserPrincipal> |
searchUsers(java.lang.String searchExpression,
int maxResults)
Returns all users, up to the specified upper limit, with names that matches the given search expression.
|
void |
setDisplayName(PrincipalName principalName,
java.lang.String displayName)
Sets the display name for the given principal (user or group).
|
void |
setEmail(PrincipalName principalName,
java.lang.String email)
Sets the e-mail address for the given principal (user or group).
|
void |
setMembers(GroupName groupName,
java.util.List<PrincipalName> memberNames)
Sets the given principals (users or groups) as members of the given group.
|
void |
setName(PrincipalName principalName,
java.lang.String name)
Sets the name for the given principal (user or group).
|
void |
setPassword(UserName userName,
java.lang.String password)
Sets the password for the given user.
|
void |
setUserEnabled(UserName userName,
boolean enabled)
Enables or disables the given user.
|
UserPrincipal getUserByName(UserName userName) throws UserDirectoryServiceException
userName
- the name of the user, must not be nullUserDirectoryServiceException
- if the user name is null or if an unexpected error occursGroupPrincipal getGroupByName(GroupName groupName) throws UserDirectoryServiceException
groupName
- the name of the group, must not be nullUserDirectoryServiceException
- if the group name is null or if an unexpected error occursUserPrincipal getUserById(Guid id) throws UserDirectoryServiceException
id
- the ID of the user, must not be nullUserDirectoryServiceException
- if the ID is null or if an unexpected error occursGroupPrincipal getGroupById(Guid id) throws UserDirectoryServiceException
id
- the ID of the group, must not be nullUserDirectoryServiceException
- if the ID is null or if an unexpected error occursjava.util.List<UserPrincipal> searchUsers(java.lang.String searchExpression, int maxResults) throws UserDirectoryServiceException
The search expression should be a user name, or part thereof, with optional '?' (matches any single character) and '*' (matches zero or more characters) wildcards.
searchExpression
- the search expression to match with the users' names, must not be null or emptymaxResults
- the maximum number of users to return, or a non-positive value if no limit should be imposedUserDirectoryServiceException
- if the search expression is null or empty or if an unexpected error occursjava.util.List<GroupPrincipal> searchGroups(java.lang.String searchExpression, int maxResults) throws UserDirectoryServiceException
The search expression should be a group name, or part thereof, with optional '?' (matches any single character) and '*' (matches zero or more characters) wildcards.
searchExpression
- the search expression to match with the groups' namesmaxResults
- the maximum number of groups to return, or a non-positive value if no limit should be imposedUserDirectoryServiceException
- if the search expression is null or empty or if an unexpected error occursjava.util.List<SpotfirePrincipal> getMembers(GroupName groupName) throws UserDirectoryServiceException
groupName
- the name of the group, must not be nullUserDirectoryServiceException
- if no group with the given name exists or if an unexpected error occursjava.util.List<GroupPrincipal> getImmediateGroups(PrincipalName principalName) throws UserDirectoryServiceException
principalName
- the name of the principal, must not be nullUserDirectoryServiceException
- if no principal with the given type and name exists or if an unexpected error
occursjava.util.List<GroupPrincipal> getAllGroups(PrincipalName principalName) throws UserDirectoryServiceException
principalName
- the name of the principal, must not be nullUserDirectoryServiceException
- if no principal with the given type and name exists or if an unexpected error
occursUserPrincipal createUser(java.lang.String username, java.lang.String domainName, java.lang.String displayName, java.lang.String email, java.lang.String password) throws UserDirectoryServiceException
username
- the name of the user, must not be null or an empty string and must not exceed 50 charactersdomainName
- the domain name, must not be null or an empty string and must not exceed 50 charactersdisplayName
- the display name, must not be null or an empty string and must not exceed 100 charactersemail
- the e-mail address, may be null but must not be an empty string or an invalid e-mail addresspassword
- the new password, may be null but must not be an empty stringUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the user name, the
display name, the e-mail address or the password is invalid, if a user with the same name already exists
in the same domain or if an unexpected error occursGroupPrincipal createGroup(java.lang.String groupname, java.lang.String displayName, java.lang.String email) throws UserDirectoryServiceException
groupname
- the name of the group, must not be null or an empty string and must not exceed 50 charactersdisplayName
- the display name, must not be null or an empty string and must not exceed 100 charactersemail
- the e-mail address, may be null but must not be an empty string or an invalid e-mail addressUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the group name,
the display name or the e-mail address is invalid, if a group with the same name already exists in the
same domain or if an unexpected error occursvoid removePrincipals(java.util.List<PrincipalName> principalNames) throws UserDirectoryServiceException
principalNames
- the names of the principals to remove, may be empty in which case no changes will be madeUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges or if an unexpected
error occursvoid setName(PrincipalName principalName, java.lang.String name) throws UserDirectoryServiceException
principalName
- the name of the principal to set the name for, must not be nullname
- the new name, must not be null or an empty string and must not exceed 50 charactersUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the principal
doesn't exist, if the name is invalid, if another principal of the same type with the new name already
exists in the same domain or if an unexpected error occursvoid setDisplayName(PrincipalName principalName, java.lang.String displayName) throws UserDirectoryServiceException
principalName
- the name of the principal to set the display name for, must not be nulldisplayName
- the new display name, must not be null or an empty string and must not exceed 100 charactersUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the principal
doesn't exist, if the display name is invalid or if an unexpected error occursvoid setEmail(PrincipalName principalName, java.lang.String email) throws UserDirectoryServiceException
principalName
- the name of the principal to set the e-mail address for, must not be nullemail
- the new e-mail address, may be null but must not be an empty string or an invalid e-mail addressUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the principal
doesn't exist, if the e-mail address is invalid or if an unexpected error occursvoid setPassword(UserName userName, java.lang.String password) throws UserDirectoryServiceException
userName
- the name of the user to set the password for, must not be nullpassword
- the new password, may be null but must not be an empty stringUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the user doesn't
exist, if the password is invalid or if an unexpected error occursvoid setUserEnabled(UserName userName, boolean enabled) throws UserDirectoryServiceException
userName
- the name of the user to set the enabled flag for, must not be nullenabled
- the new value for the enabled flagUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the user doesn't
exist or if an unexpected error occursboolean isMember(GroupName groupName, PrincipalName principalName) throws UserDirectoryServiceException
groupName
- the name of the group to determine membership of, must not be nullprincipalName
- the name of the principal to determine membership for, must not be nullUserDirectoryServiceException
- if the group or the principal doesn't exist or if an unexpected error occursvoid addMembers(GroupName groupName, java.util.List<PrincipalName> memberNames) throws UserDirectoryServiceException
groupName
- the name of the group which the principals should be added tomemberNames
- the names of the principals that should be added to the groupUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the group
principal or any of the member principals doesn't exist of if an unexpected error occursvoid removeMembers(GroupName groupName, java.util.List<PrincipalName> memberNames) throws UserDirectoryServiceException
groupName
- the name of the group which the principals should be removed frommemberNames
- the names of the principals that should be removed from the groupUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the group
principal doesn't exists of if an error occursvoid setMembers(GroupName groupName, java.util.List<PrincipalName> memberNames) throws UserDirectoryServiceException
groupName
- the name of the group which the the members should be setmemberNames
- the names of the the principals that should be set as members of the groupUserDirectoryServiceException
- if the calling user doesn't have sufficient privileges, if the group
principal or any of the member principals doesn't exists of if an error occursCopyright © 2013-2020 TIBCO Software Inc. All Rights Reserved.