public interface UserDirectory
Modifier and Type | Field and Description |
---|---|
static int |
OPERATION_READ_GROUPS
Constant specifying the operation of reading groups.
|
static int |
OPERATION_READ_USERS
Constant specifying the operation of reading users.
|
static int |
OPERATION_WRITE_GROUPS
Constant specifying the operation of writing groups.
|
static int |
OPERATION_WRITE_USERS
Constant specifying the operation of writing users.
|
static int |
SERVICE_PROVIDER_ALL
Constant specifying the internal and external service providers.
|
static int |
SERVICE_PROVIDER_EXTERNAL
Constant specifying the external service provider.
|
static int |
SERVICE_PROVIDER_INTERNAL
Constant specifying the internal service provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addMember(GroupPrincipal group,
SpotfirePrincipal principal)
Adds a member to a group principal in the directory.
|
GroupPrincipal |
createGroupPrincipal(java.lang.String name)
Creates a new group principal in the directory.
|
UserPrincipal |
createUserPrincipal(java.lang.String name,
java.lang.String password)
Creates a new user principal in the directory.
|
UserPrincipal |
createUserPrincipal(java.lang.String name,
java.lang.String domainName,
java.lang.String password)
Creates a new user principal in the directory.
|
GroupPrincipal |
getAdministratorGroup()
Returns the Administrator group principal.
|
GroupPrincipal[] |
getDefaultGroups()
Returns an array containing the default groups on the server.
|
GroupPrincipal |
getGroupPrincipal(java.lang.String name)
Returns the group principal with the specified name from the directory.
|
GroupPrincipal |
getGroupPrincipal(java.lang.String name,
java.lang.String domainName)
Returns the group principal with the specified name and domain from the directory.
|
GroupPrincipal[] |
getGroupPrincipals()
Returns an array containing all group principals in the directory.
|
GroupPrincipal[] |
getGroupPrincipals(java.lang.String regExp)
Returns an array containing all group principals with names that matches the given regular expression.
|
GroupPrincipal[] |
getGroups(SpotfirePrincipal principal)
Returns an array containing all groups of which the specified principal is an immediate member.
|
GroupPrincipal[] |
getGroupsRecursive(SpotfirePrincipal principal)
Returns an array containing all groups of which the specified principal is a member.
|
GroupPrincipal[] |
getImmutableGroups()
Returns an array containing all immutable groups on the server.
|
SpotfirePrincipal[] |
getMembers(GroupPrincipal group)
Returns an array containing all immediate members (both users and other groups) of a group in the directory.
|
GroupPrincipal |
getPrimaryGroup(SpotfirePrincipal principal)
Returns the specified principal's primary group.
|
SpotfirePrincipal |
getPrincipal(Guid guid)
Returns the principal with the specified GUID from the directory.
|
UserPrincipal |
getUserPrincipal(java.lang.String name)
Returns the user principal with the specified name from the directory.
|
UserPrincipal |
getUserPrincipal(java.lang.String name,
java.lang.String domainName)
Returns the user principal with the specified name and domain from the directory.
|
UserPrincipal[] |
getUserPrincipals()
Returns an array containing all user principals in the directory.
|
UserPrincipal[] |
getUserPrincipals(java.lang.String regExp)
Returns an array containing all user principals with names that
matches the given regular expression.
|
boolean |
isAdministrator(UserPrincipal user)
Queries whether or not the given user is an administrator of the server,
i.e.
|
boolean |
isDefaultGroup(GroupPrincipal group)
Returns
true if the given group is a default group. |
boolean |
isImmutableGroup(GroupPrincipal group)
Returns
true if the given group is immutable. |
boolean |
isMember(GroupPrincipal group,
SpotfirePrincipal principal)
Check if a principal is member of a group.
|
boolean |
isOperationSupported(int operation,
int serviceProvider)
Check if an operation is supported by the user directory or not.
|
void |
removeMember(GroupPrincipal group,
SpotfirePrincipal principal)
Removes a member from a group in the directory.
|
void |
removePrincipal(SpotfirePrincipal principal)
Removes a principal from the directory.
|
void |
renamePrincipal(SpotfirePrincipal principal,
java.lang.String name)
Changes the name of a principal in the directory.
|
void |
setGroups(SpotfirePrincipal principal,
GroupPrincipal[] groups)
Set all groups that a principal belongs to.
|
void |
setMembers(GroupPrincipal group,
SpotfirePrincipal[] principals)
Sets all members of a group.
|
void |
setPassword(UserPrincipal user,
java.lang.String password)
Changes the password for a user.
|
void |
setPrimaryGroup(SpotfirePrincipal principal,
GroupPrincipal primaryGroup)
Sets the primary group for the specified principal.
|
static final int OPERATION_READ_USERS
static final int OPERATION_WRITE_USERS
static final int OPERATION_READ_GROUPS
static final int OPERATION_WRITE_GROUPS
static final int SERVICE_PROVIDER_INTERNAL
static final int SERVICE_PROVIDER_EXTERNAL
static final int SERVICE_PROVIDER_ALL
UserPrincipal getUserPrincipal(java.lang.String name)
name
- the name of the userUserPrincipal
if the directory contains a user with the given name,
or null
if such a user does not existUserDirectoryException
- if an error occurred in the service providerUserPrincipal getUserPrincipal(java.lang.String name, java.lang.String domainName)
name
- the name of the userdomainName
- the name of the user's domainUserPrincipal
if the directory contains a user with the given name,
or null
if such a user does not existUserDirectoryException
- if an error occurred in the service providerGroupPrincipal getGroupPrincipal(java.lang.String name)
name
- the name of the groupGroupPrincipal
if the directory contains a group with the given name,
or null
if such a group does not existUserDirectoryException
- if an error occurred in the service providerGroupPrincipal getGroupPrincipal(java.lang.String name, java.lang.String domainName)
name
- the name of the groupdomainName
- the name of the group domainGroupPrincipal
if the directory contains a group with the given name,
or null
if such a group does not existUserDirectoryException
- if an error occurred in the service providerSpotfirePrincipal getPrincipal(Guid guid)
guid
- the GUID of the principalUserPrincipal
or a GroupPrincipal
if the directory contains a principal with the given GUID, or
null
if such a principal does not existUserDirectoryException
- if an error occurred in the service providerUserPrincipal[] getUserPrincipals()
UserDirectoryException
- if an error occurred in the service providerUserPrincipal[] getUserPrincipals(java.lang.String regExp)
regExp
- a regular expression following the syntax of the Pattern
Java APIjava.lang.IllegalArgumentException
- if the given regular expression is invalidUserDirectoryException
- if an error occurred in the service providerGroupPrincipal[] getGroupPrincipals()
UserDirectoryException
- if an error occurred in the service providerGroupPrincipal[] getGroupPrincipals(java.lang.String regExp)
regExp
- a regular expression following the syntax of the Pattern
Java APIjava.lang.IllegalArgumentException
- if the given regular expression is invalidUserDirectoryException
- if an error occurred in the service providerSpotfirePrincipal[] getMembers(GroupPrincipal group)
group
- a group principalSpotfirePrincipal
array containing all immediate group members,
where each member is either a UserPrincipal
or a GroupPrincipal
object.NoSuchPrincipalException
- if the given group cannot be found in the directoryUserDirectoryException
- if an error occurred in the service providerboolean isMember(GroupPrincipal group, SpotfirePrincipal principal)
group
- a group principalprincipal
- the principal to check membership fortrue
if the given principal is a member of the group, otherwise false
NoSuchPrincipalException
- if the given group or principal cannot be found in the directoryUserDirectoryException
- if an error occurred in the service providerGroupPrincipal[] getGroups(SpotfirePrincipal principal)
principal
- the principal to retrieve groups forNoSuchPrincipalException
- if the given principal cannot be found in the directoryUserDirectoryException
- if an error occurred in the service providerGroupPrincipal[] getDefaultGroups()
UserDirectoryException
- if an error occurred in the service providerGroupPrincipal[] getImmutableGroups()
UserDirectoryException
- if an error occurred in the service providerboolean isImmutableGroup(GroupPrincipal group)
true
if the given group is immutable.group
- a grouptrue
if the given group is immutable, false
otherwiseboolean isDefaultGroup(GroupPrincipal group)
true
if the given group is a default group.group
- a grouptrue
if the given group is a default group, false
otherwiseboolean isAdministrator(UserPrincipal user)
user
- a usertrue
if the given user is an administrator, false
otherwiseGroupPrincipal getAdministratorGroup()
UserDirectoryException
- if an error occurred in the service providerUserPrincipal createUserPrincipal(java.lang.String name, java.lang.String password)
name
- the name of the user principal to be createdpassword
- the password for the user principal to be createdPrincipalAlreadyExistsException
- if a principal with the specified name already exists in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support creating user principalsUserDirectoryException
- if an error occurred in the service providerUserPrincipal createUserPrincipal(java.lang.String name, java.lang.String domainName, java.lang.String password)
name
- the name of the user principal to be createddomainName
- the name of the user's domainpassword
- the password for the user principal to be createdPrincipalAlreadyExistsException
- if a principal with the specified name already exists in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support creating user principalsUserDirectoryException
- if an error occurred in the service providervoid setPassword(UserPrincipal user, java.lang.String password)
user
- the user whose password to changepassword
- the new passwordNoSuchPrincipalException
- if the given user principal cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support modifying passwordsGroupPrincipal createGroupPrincipal(java.lang.String name)
name
- the name of the group principal to be createdPrincipalAlreadyExistsException
- if a principal with the specified name already exists in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support creating group principalsUserDirectoryException
- if an error occurred in the service providervoid removePrincipal(SpotfirePrincipal principal)
principal
- the principal to be removedNoSuchPrincipalException
- if the given principal cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support removing principalsUserDirectoryException
- if an error occurred in the service providervoid renamePrincipal(SpotfirePrincipal principal, java.lang.String name)
principal
- the principal to change the name forname
- the new nameNoSuchPrincipalException
- if the given principal cannot be found in the directoryPrincipalAlreadyExistsException
- if a principal with the specified name already exists in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support renaming principalsUserDirectoryException
- if an error occurred in the service providervoid addMember(GroupPrincipal group, SpotfirePrincipal principal)
group
- the group principal to add a member toprincipal
- the principal to be added as a memberNoSuchPrincipalException
- if the group or the principal cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support modifying group principalsUserDirectoryException
- if an error occurred in the service providervoid removeMember(GroupPrincipal group, SpotfirePrincipal principal)
group
- the group principal to remove a member fromprincipal
- the principal to be removed as a memberNoSuchPrincipalException
- if any of the given principals cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support modifying group principalsUserDirectoryException
- if an error occurred in the service providervoid setMembers(GroupPrincipal group, SpotfirePrincipal[] principals)
group
- the group principal to set members forprincipals
- the new group membersNoSuchPrincipalException
- if any of the given principals cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support modifying group principalsUserDirectoryException
- if an error occurred in the service providervoid setGroups(SpotfirePrincipal principal, GroupPrincipal[] groups)
principal
- the principal to set group membership forgroups
- the groups which the principal should be a member ofNoSuchPrincipalException
- if the principal or any of the group principals cannot be found in the directoryReadOnlyDirectoryException
- if the directory is configured with
a service provider that does not support modifying group principalsUserDirectoryException
- if an error occurred in the underlying systemGroupPrincipal getPrimaryGroup(SpotfirePrincipal principal)
principal
- the principal whose primary group should be returnvoid setPrimaryGroup(SpotfirePrincipal principal, GroupPrincipal primaryGroup)
primaryGroup
argument set to null
.principal
- the principal to set the primary group forprimaryGroup
- the principal's primary groupInvalidPrimaryGroupException
- if the specified primary group is invalidboolean isOperationSupported(int operation, int serviceProvider)
operation
- UserDirectory.OPERATION_READ_USERS
, UserDirectory.OPERATION_WRITE_USERS
,
UserDirectory.OPERATION_READ_GROUPS
or UserDirectory.OPERATION_WRITE_GROUPS
.serviceProvider
- UserDirectory.SERVICE_PROVIDER_INTERNAL
, UserDirectory.SERVICE_PROVIDER_EXTERNAL
or UserDirectory.SERVICE_PROVIDER_ALL
.true
if the operation is supported, false
otherwise.GroupPrincipal[] getGroupsRecursive(SpotfirePrincipal principal)
principal
- the principal to retrieve groups forNoSuchPrincipalException
- if the given principal cannot be found in the directoryUserDirectoryException
- if an error occurred in the underlying systemCopyright © 2000-2020 TIBCO Software Inc. All Rights Reserved.