|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteDirectory
Gateway to perform operations on the physical remote directory.
Implementations will be provided an directoryId and Map of attributes.
Method Summary | |
---|---|
Group |
addGroup(GroupTemplate group)
Adds a group to the directory store. |
void |
addGroupToGroup(String childGroup,
String parentGroup)
Adds a group as a member of a parent group. |
User |
addUser(UserTemplate user,
PasswordCredential credential)
Adds a user to the directory store. |
void |
addUserToGroup(String username,
String groupName)
Adds a user as a member of a group. |
User |
authenticate(String name,
PasswordCredential credential)
Authenticates a user with the directory store. |
Group |
findGroupByName(String name)
Finds the group that matches the supplied name . |
GroupWithAttributes |
findGroupWithAttributesByName(String name)
Finds the group that matches the supplied name . |
User |
findUserByName(String name)
Finds the user that matches the supplied name . |
UserWithAttributes |
findUserWithAttributesByName(String name)
Finds the user that matches the supplied name . |
String |
getDescriptiveName()
Returns a descriptive name for the type of directory. |
long |
getDirectoryId()
Gets the internal unique directoryId of the directory store. |
boolean |
isGroupDirectGroupMember(String childGroup,
String parentGroup)
Determines if a group is a direct member of another group. |
boolean |
isUserDirectGroupMember(String username,
String groupName)
Determines if a user is a direct member of a group. |
void |
removeGroup(String name)
Removes the group that matches the supplied name . |
void |
removeGroupAttributes(String groupName,
String attributeName)
Removes all the values for a single attribute key for a group. |
void |
removeGroupFromGroup(String childGroup,
String parentGroup)
Removes a group as a member of a parent group. |
void |
removeUser(String name)
Removes the user that matches the supplied name . |
void |
removeUserAttributes(String username,
String attributeName)
Removes all the values for a single attribute key for a user. |
void |
removeUserFromGroup(String username,
String groupName)
Removes a user as a member of a group. |
Group |
renameGroup(String oldName,
String newName)
Renames a group . |
User |
renameUser(String oldName,
String newName)
Renames a user . |
List |
searchGroupRelationships(MembershipQuery query)
Searches for membership information. |
List |
searchGroups(EntityQuery query)
Searches for groups that match the supplied query criteria. |
List |
searchUsers(EntityQuery query)
Searches for users that match the supplied query criteria. |
void |
setAttributes(Map<String,String> attributes)
When a directory store is loaded, the attributes map will be set by the Crowd framework. |
void |
setDirectoryId(long directoryId)
When a directory store is loaded, the directoryId will be set by the
crowd framework. |
void |
storeGroupAttributes(String groupName,
Map<String,List<String>> attributes)
Adds or updates a group's attributes with the new Map of attribute values in the directory specified by the passed in directoryId . |
void |
storeUserAttributes(String username,
Map<String,List<String>> attributes)
Adds or updates a user's attributes with the new Map of attribute values in the directory specified by the passed in directoryId . |
boolean |
supportsNestedGroups()
Allows us to only display nested-group related UI for directories that support it. |
void |
testConnection()
Test if a connection to the directory server can be established. |
Group |
updateGroup(GroupTemplate group)
Updates the group . |
User |
updateUser(UserTemplate user)
Updates the user . |
void |
updateUserCredential(String username,
PasswordCredential credential)
Updates the password for a user . |
Methods inherited from interface com.atlassian.crowd.integration.model.AttributeAware |
---|
getAttribute, getAttributeNames, getAttributes, hasAttribute |
Method Detail |
---|
long getDirectoryId()
directoryId
of the directory store.
directoryId
.void setDirectoryId(long directoryId)
directoryId
will be set by the
crowd framework.
directoryId
- The unique directoryId
of the Directory
stored in the database.String getDescriptiveName()
void setAttributes(Map<String,String> attributes)
attributes
- attributes map.User findUserByName(String name) throws ObjectNotFoundException
user
that matches the supplied name
.
name
- the name of the user (username).
ObjectNotFoundException
- a user with the supplied name does not exist.UserWithAttributes findUserWithAttributesByName(String name) throws ObjectNotFoundException
user
that matches the supplied name
.
name
- the name of the user (username).
ObjectNotFoundException
- a user with the supplied name does not exist.User authenticate(String name, PasswordCredential credential) throws ObjectNotFoundException, InactiveAccountException, InvalidAuthenticationException
user
with the directory store.
name
- The name of the user (username).credential
- The supplied credentials (password).
InactiveAccountException
- The supplied user is inactive.
InvalidAuthenticationException
- Authentication with the provided credentials failed.
ObjectNotFoundException
- The user wth the supplied name does not exist.User addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, ObjectNotFoundException, InvalidCredentialException
user
to the directory store.
user
- template of the user to add.credential
- password. May be null, since JIRA creates a user in two steps (user THEN password)
InvalidUserException
- The supplied user is invalid.
ObjectNotFoundException
- The user could not be looked up after creation or the directory with the ID of user.directoryId does not exist.
InvalidCredentialException
- The supplied credential is invalid.User updateUser(UserTemplate user) throws InvalidUserException, ObjectNotFoundException
user
.
user
- The user to update.
ObjectNotFoundException
- the user does not exist in the directory store.
InvalidUserException
- the supplied user is invalid.void updateUserCredential(String username, PasswordCredential credential) throws ObjectNotFoundException, InvalidCredentialException
password
for a user
.
username
- The name of the user (username).credential
- The new credential (password).
ObjectNotFoundException
- The user does not exist.
InvalidCredentialException
- The supplied credential is invalid.User renameUser(String oldName, String newName) throws ObjectNotFoundException, InvalidUserException
user
.
oldName
- name of existing user.newName
- desired name of user.
ObjectNotFoundException
- if the user with the existing name does not exist.
InvalidUserException
- if the new username is invalid or already exists in the directory.void storeUserAttributes(String username, Map<String,List<String>> attributes) throws ObjectNotFoundException
directoryId
.
The attributes map represents new or updated attributes and does not replace existing attributes unless the key of an attribute
matches the key of an existing
username
- name of user to update.attributes
- new or updated attributes (attributes that don't need changing should not appear in this Map).
ObjectNotFoundException
- user with supplied username does not exist.void removeUserAttributes(String username, String attributeName) throws ObjectNotFoundException
username
- name of the user to update.attributeName
- name of attribute to remove.
ObjectNotFoundException
- user with supplied username does not exist.void removeUser(String name) throws ObjectNotFoundException
user
that matches the supplied name
.
name
- The name of the user (username).
ObjectNotFoundException
- The user does not exist.List searchUsers(EntityQuery query)
users
that match the supplied query criteria.
query
- EntityQuery for Entity.USER.
List<User
>
or List<String
>
of users/usernames
matching the search criteria. An empty List
will be returned
if no users matching the criteria are found.Group findGroupByName(String name) throws ObjectNotFoundException
group
that matches the supplied name
.
name
- the name of the group.
ObjectNotFoundException
- a group with the supplied name does not exist.GroupWithAttributes findGroupWithAttributesByName(String name) throws ObjectNotFoundException
group
that matches the supplied name
.
name
- the name of the group.
ObjectNotFoundException
- a group with the supplied name does not exist.Group addGroup(GroupTemplate group) throws InvalidGroupException, ObjectNotFoundException
group
to the directory store.
group
- template of the group to add.
InvalidGroupException
- The supplied group is invalid.
ObjectNotFoundException
- The group could not be looked up after creation or the directory with the ID of group.directoryId does not exist.Group updateGroup(GroupTemplate group) throws InvalidGroupException, ObjectNotFoundException
group
.
group
- The group to update.
ObjectNotFoundException
- the group does not exist in the directory store.
InvalidGroupException
- the supplied group is invalid.Group renameGroup(String oldName, String newName) throws ObjectNotFoundException, InvalidGroupException
group
.
oldName
- name of existing group.newName
- desired name of group.
ObjectNotFoundException
- if the group with the existing name does not exist.
InvalidGroupException
- if the new groupname is invalid or already exists in the directory.void storeGroupAttributes(String groupName, Map<String,List<String>> attributes) throws ObjectNotFoundException
directoryId
.
The attributes map represents new or updated attributes and does not replace existing attributes unless the key of an attribute
matches the key of an existing
groupName
- name of group to update.attributes
- new or updated attributes (attributes that don't need changing should not appear in this Map).
ObjectNotFoundException
- group with supplied groupName does not exist.void removeGroupAttributes(String groupName, String attributeName) throws ObjectNotFoundException
groupName
- name of the group to update.attributeName
- name of attribute to remove.
ObjectNotFoundException
- group with supplied groupName does not exist.void removeGroup(String name) throws ObjectNotFoundException
group
that matches the supplied name
.
name
- The name of the group.
ObjectNotFoundException
- The group does not exist.List searchGroups(EntityQuery query)
groups
that match the supplied query criteria.
query
- EntityQuery for Entity.GROUP.
List
or List
of groups/groupnames
matching the search criteria. An empty List
will be returned
if no groups matching the criteria are found.boolean isUserDirectGroupMember(String username, String groupName)
username
- name of user.groupName
- name of group.
true
iff the user is a direct member of the group.boolean isGroupDirectGroupMember(String childGroup, String parentGroup)
childGroup
- name of child group.parentGroup
- name of parent group.
true
iff the childGroup is a direct member of the parentGroup.void addUserToGroup(String username, String groupName) throws ObjectNotFoundException
childGroup
will
appear as members of parentGroup
to querying applications.
username
- The user that will become a member of groupName
groupName
- The group that will gain a new member.
ObjectNotFoundException
- If the user or group cannot be found.void addGroupToGroup(String childGroup, String parentGroup) throws ObjectNotFoundException, InvalidMembershipException
parentGroup
- The group that will gain a new memberchildGroup
- The group that will become a member of parentGroup
ObjectNotFoundException
- One or both of the groups cannot be found.
InvalidMembershipException
- if the childGroup and parentGroup exist but are of different GroupTypes.void removeUserFromGroup(String username, String groupName) throws ObjectNotFoundException, MembershipNotFoundException
groupName
- The group that will lose the member.username
- The user that will be removed from parentGroup
ObjectNotFoundException
- If either the user or group cannot be found.
MembershipNotFoundException
- if the user is not a direct member of the group.void removeGroupFromGroup(String childGroup, String parentGroup) throws ObjectNotFoundException, InvalidMembershipException, MembershipNotFoundException
parentGroup
- The group that will lose the member.childGroup
- The group that will be removed from parentGroup
ObjectNotFoundException
- One or both of the groups cannot be found.
InvalidMembershipException
- if the childGroup and parentGroup exist but are of different GroupTypes.
MembershipNotFoundException
- if the childGroup is not a direct member of the parentGroup.List searchGroupRelationships(MembershipQuery query)
query
- query for memberships.
void testConnection() throws DirectoryAccessException
DirectoryAccessException
- An unknown wire exception occurred.boolean supportsNestedGroups()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |