|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserDirectory
This interface provides functionality to list and modify users and groups in DS Server.
| Field Summary | |
|---|---|
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 |
| Method Summary | |
|---|---|
void |
addMember(GroupPrincipal group,
SpotfirePrincipal principal)
Adds a member to a group principal in the directory. |
GroupPrincipal |
createGroupPrincipal(String name)
Creates a new group principal in the directory. |
UserPrincipal |
createUserPrincipal(String name,
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(String name)
Returns the group principal with the specified name from the directory. |
GroupPrincipal[] |
getGroupPrincipals()
Returns an array containing all group principals in the directory. |
GroupPrincipal[] |
getGroupPrincipals(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[] |
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(String name)
Returns the user principal with the specified name from the directory. |
UserPrincipal[] |
getUserPrincipals()
Returns an array containing all user principals in the directory. |
UserPrincipal[] |
getUserPrincipals(String regExp)
Returns an array containing all user principals with names that matches the given regular expression. |
boolean |
isAdministrator(UserPrincipal user)
|
boolean |
isDefaultGroup(GroupPrincipal group)
|
boolean |
isImmutableGroup(GroupPrincipal group)
|
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,
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,
String password)
Changes the password for a user |
void |
setPrimaryGroup(SpotfirePrincipal principal,
GroupPrincipal primaryGroup)
Sets the primary group for the specified principal. |
| Field Detail |
|---|
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
| Method Detail |
|---|
UserPrincipal getUserPrincipal(String name)
name - the name of the user
UserPrincipal
if the directory contains a user with the given name, or
null if such a user does not exist
UserDirectoryException - if an error occurred in the service providerGroupPrincipal getGroupPrincipal(String name)
name - the name of the group
GroupPrincipal
if the directory contains a group with the given name, or
null if such a group does not exist
UserDirectoryException - if an error occurred in the service providerSpotfirePrincipal getPrincipal(Guid guid)
guid - the GUID of the principal
UserPrincipal or a GroupPrincipal
if the directory contains a principal with the given GUID, or
null if such a principal does not exist
UserDirectoryException - if an error occurred in the service providerUserPrincipal[] getUserPrincipals()
UserDirectoryException - if an error occurred in the service providerUserPrincipal[] getUserPrincipals(String regExp)
regExp - a regular expression
This follows the syntax of java.util.regex.Pattern in jdk 1.4
IllegalArgumentException - if the given regular expression
is invalid
UserDirectoryException - if an error occurred in the service providerGroupPrincipal[] getGroupPrincipals()
UserDirectoryException - if an error occurred in the service providerGroupPrincipal[] getGroupPrincipals(String regExp)
regExp - a regular expression.
This follows the syntax of java.util.regex.Pattern in jdk 1.4
IllegalArgumentException - if the given regular expression
is invalid
UserDirectoryException - if an error occurred in the service providerSpotfirePrincipal[] getMembers(GroupPrincipal group)
group - a group principal
SpotfirePrincipal array containing
all immediate group members. Each can be either a
UserPrincipal or a GroupPrincipal object.
NoSuchPrincipalException - if the given group cannot be
found in the directory
UserDirectoryException - if an error occurred in the service provider
boolean isMember(GroupPrincipal group,
SpotfirePrincipal principal)
group - a group principalprincipal - the principal to check membership for
true if the given principal is a member of
the group, otherwise false
NoSuchPrincipalException - if the given group or principal
cannot be found in the directory
UserDirectoryException - if an error occurred in the service providerGroupPrincipal[] getGroups(SpotfirePrincipal principal)
principal - the principal to retrieve groups for
NoSuchPrincipalException - if the given principal cannot be
found in the directory
UserDirectoryException - 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)
boolean isDefaultGroup(GroupPrincipal group)
boolean isAdministrator(UserPrincipal user)
GroupPrincipal getAdministratorGroup()
UserDirectoryException - if an error occurred in the service provider
UserPrincipal createUserPrincipal(String name,
String password)
name - the name of the user principal to be createdpassword - the password for the user principal to be created
PrincipalAlreadyExistsException - if a principal with the
specified name already exists in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support creating user principals.
UserDirectoryException - if an error occurred in the service provider
void setPassword(UserPrincipal user,
String password)
user - the user whos password to changepassword - the new password
NoSuchPrincipalException - if the given user principal
cannot be found in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support modifying passwords.GroupPrincipal createGroupPrincipal(String name)
name - the name of the group principal to be created
PrincipalAlreadyExistsException - if a principal with the
specified name already exists in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support creating group principals.
UserDirectoryException - if an error occurred in the service providervoid removePrincipal(SpotfirePrincipal principal)
principal - the principal to be removed
NoSuchPrincipalException - if the given principal
cannot be found in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support removing principals.
UserDirectoryException - if an error occurred in the service provider
void renamePrincipal(SpotfirePrincipal principal,
String name)
principal - the principal to change the name forname - the new name
NoSuchPrincipalException - if the given principal
cannot be found in the directory
PrincipalAlreadyExistsException - if a principal with the
specified name already exists in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support renaming principals.
UserDirectoryException - if an error occurred in the service provider
void addMember(GroupPrincipal group,
SpotfirePrincipal principal)
group - the group principal to add a member toprincipal - the principal to be added as a member
NoSuchPrincipalException - if the group or the principal
cannot be found in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support modifying group principals.
UserDirectoryException - if an error occurred in the service provider
void removeMember(GroupPrincipal group,
SpotfirePrincipal principal)
group - the group principal to remove a member fromprincipal - the principal to be removed as a member
NoSuchPrincipalException - if any of the given principals
cannot be found in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support modifying group principals.
UserDirectoryException - if an error occurred in the service provider
void setMembers(GroupPrincipal group,
SpotfirePrincipal[] principals)
group - the group principal to set members forprincipals - the new group members
NoSuchPrincipalException - if any of the given principals
cannot be found in the directory
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support modifying group principals.
UserDirectoryException - if an error occurred in the service provider
void setGroups(SpotfirePrincipal principal,
GroupPrincipal[] groups)
principal - groups -
NoSuchPrincipalException - if the principal or any of the
group principals cannot be found in the directory.
ReadOnlyDirectoryException - if the directory is configured with
a service provider that does not support modifying group principals.
UserDirectoryException - if an error occurred in the underlying systemGroupPrincipal getPrimaryGroup(SpotfirePrincipal principal)
principal - the principal whose primary group should be return
void setPrimaryGroup(SpotfirePrincipal principal,
GroupPrincipal primaryGroup)
primaryGroup
argument set to null.
principal - the principal to set the primary group forprimaryGroup - the principal's primary group
InvalidPrimaryGroupException - if the specified primary group is invalid
boolean 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||