com.atlassian.crowd.directory
Interface InternalRemoteDirectory

All Superinterfaces:
Attributes, RemoteDirectory

public interface InternalRemoteDirectory
extends RemoteDirectory

This interface represents a specialised extension of RemoteDirectory that is used by InternalDirectories.

In particular, the findUserByName(String) and findGroupByName(String) have been redefined to return TimestampedUser and InternalDirectoryGroup. The InternalDirectoryGroup allows clients to determine whether the group is "local".


Method Summary
 BatchResult<Group> addAllGroups(java.util.Set<GroupTemplate> groups)
          Adds a collection of groups to the directory.
 BatchResult<User> addAllUsers(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
          Adds a collection of users to the directory.
 BatchResult<java.lang.String> addAllUsersToGroup(java.util.Set<java.lang.String> userNames, java.lang.String groupName)
          Adds a collection of users to a group.
 Group addLocalGroup(GroupTemplate group)
          Adds a "local" group to the directory.
 InternalDirectoryGroup findGroupByName(java.lang.String name)
          Finds the group that matches the supplied name.
 TimestampedUser findUserByName(java.lang.String name)
          Finds the user that matches the supplied name.
 void removeAllGroups(java.util.Set<java.lang.String> groupNames)
          Removes all groups from the directory.
 void removeAllUsers(java.util.Set<java.lang.String> usernames)
          Removes all users from the directory.
 
Methods inherited from interface com.atlassian.crowd.directory.RemoteDirectory
addGroup, addGroupToGroup, addUser, addUserToGroup, authenticate, findGroupWithAttributesByName, findUserWithAttributesByName, getAuthoritativeDirectory, getDescriptiveName, getDirectoryId, getMemberships, isGroupDirectGroupMember, isRolesDisabled, isUserDirectGroupMember, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, searchGroupRelationships, searchGroups, searchUsers, setAttributes, setDirectoryId, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsNestedGroups, testConnection, updateGroup, updateUser, updateUserCredential
 
Methods inherited from interface com.atlassian.crowd.embedded.api.Attributes
getKeys, getValue, getValues, isEmpty
 

Method Detail

findUserByName

TimestampedUser findUserByName(java.lang.String name)
                               throws UserNotFoundException
Description copied from interface: RemoteDirectory
Finds the user that matches the supplied name.

Specified by:
findUserByName in interface RemoteDirectory
Parameters:
name - the name of the user (username).
Returns:
TimestampedUser entity.
Throws:
UserNotFoundException - a user with the supplied name does not exist.

findGroupByName

InternalDirectoryGroup findGroupByName(java.lang.String name)
                                       throws GroupNotFoundException
Description copied from interface: RemoteDirectory
Finds the group that matches the supplied name.

Specified by:
findGroupByName in interface RemoteDirectory
Parameters:
name - the name of the group.
Returns:
InternalDirectoryGroup entity.
Throws:
GroupNotFoundException - a group with the supplied name does not exist.

addLocalGroup

Group addLocalGroup(GroupTemplate group)
                    throws InvalidGroupException,
                           OperationFailedException
Adds a "local" group to the directory. This method can be used to store groups that aren't clones of "external" groups. For example, if an LDAP directory is cloned in an internal directory, it's possible to define "local" groups that exist internally but not in LDAP. This functionality was added to meet the functionality that Confluence provided.

Parameters:
group - template of the group to add.
Returns:
the added group retrieved from the underlying store.
Throws:
InvalidGroupException - The supplied group is invalid.
OperationFailedException - underlying directory implementation failed to execute the operation.

addAllUsers

BatchResult<User> addAllUsers(java.util.Set<UserTemplateWithCredentialAndAttributes> users)
Adds a collection of users to the directory. The bulk adding of users may be significantly faster than adding users one-by-one for large collections. Caller must ensure that the users don't already exist.

Parameters:
users - templates of users to add.
Returns:
result containing both successful and failed users
Throws:
java.lang.IllegalArgumentException - if any of the users' directory ID does not match the directory's ID.

addAllGroups

BatchResult<Group> addAllGroups(java.util.Set<GroupTemplate> groups)
Adds a collection of groups to the directory. The bulk adding of groups may be significantly faster than adding groups one-by-one for large collections. Caller must ensure that the users don't already exist.

Parameters:
groups - templates of groups to add.
Returns:
result containing both successful and failed groups
Throws:
java.lang.IllegalArgumentException - if any of the groups' directory ID does not match the directory's ID.

addAllUsersToGroup

BatchResult<java.lang.String> addAllUsersToGroup(java.util.Set<java.lang.String> userNames,
                                                 java.lang.String groupName)
                                                 throws GroupNotFoundException
Adds a collection of users to a group. Caller must ensure that the memberships don't already exist.

Parameters:
userNames - names of users to add to group.
groupName - name of group to add users to.
Returns:
result containing both successful and failed users
Throws:
GroupNotFoundException - group with supplied groupName does not exist.

removeAllUsers

void removeAllUsers(java.util.Set<java.lang.String> usernames)
Removes all users from the directory. If a user with the supplied username does not exist in the directory, the username will be ignored.

Parameters:
usernames - usernames of users to remove.

removeAllGroups

void removeAllGroups(java.util.Set<java.lang.String> groupNames)
Removes all groups from the directory. If a group with the supplied group name does not exist in the directory, the group name will be ignored.

Parameters:
groupNames - names of groups to remove.


Copyright © 2012 Atlassian. All Rights Reserved.