public class Rfc2307 extends RFC2307Directory
attributes, contextSource, contextSourceTransactionManager, DEFAULT_PAGE_SIZE, eventPublisher, ldapPropertiesMapper, ldapQueryTranslater, ldapTemplate, nameConverter, searchDN
Constructor and Description |
---|
Rfc2307(LDAPQueryTranslater ldapQueryTranslater,
com.atlassian.event.api.EventPublisher eventPublisher,
InstanceFactory instanceFactory,
PasswordEncoderFactory passwordEncoderFactory) |
Modifier and Type | Method and Description |
---|---|
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.
|
LDAPUserWithAttributes |
addUser(UserTemplate user,
PasswordCredential credential)
Adds a user to LDAP.
|
LDAPUserWithAttributes |
addUser(UserTemplateWithAttributes user,
PasswordCredential credential)
Adds a user to LDAP.
|
void |
addUserToGroup(String username,
String groupName)
Adds a user as a member of a group.
|
protected LDAPCredentialEncoder |
getCredentialEncoder() |
String |
getDescriptiveName()
Returns a descriptive name for the type of directory.
|
protected void |
getNewUserDirectorySpecificAttributes(User user,
Attributes attributes)
Populates attributes object with directory-specific attributes.
|
static String |
getStaticDirectoryType() |
void |
removeGroup(String name)
Removes the
group that matches the supplied name . |
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 |
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 . |
Group |
updateGroup(GroupTemplate group)
Updates the
group . |
User |
updateUser(UserTemplate user)
Updates the
user . |
getCustomGroupAttributeMappers, getCustomUserAttributeMappers, getMemberships, isGroupDirectGroupMember, isUserDirectGroupMember, searchGroupRelationshipsWithGroupTypeSpecified, supportsNestedGroups, supportsPasswordExpiration
addDefaultSnToUserAttributes, addDefaultValueToUserAttributesForAttribute, asLdapGroupName, asLdapName, asLdapUserName, authenticate, avatarMapper, countDirectMembersOfGroup, createMinimalContextSource, createModificationItem, expireAllPasswords, findEntityByDN, findEntityByDN, findGroupByName, findGroupByNameAndType, findGroupWithAttributesByName, findUserByExternalId, findUserByName, findUserWithAttributesByName, getAttributeAsBoolean, getAttributeAsLong, getAuthoritativeDirectory, getBaseEnvironmentProperties, getContextSource, getDirectoryId, getGroupContextMapper, getInitialGroupMemberDN, getKeys, getLdapPropertiesMapper, getNewGroupAttributes, getNewGroupDirectorySpecificAttributes, getNewUserAttributes, getRequiredCustomGroupAttributeMappers, getSearchControls, getSearchDN, getUserAvatarByName, getUserModificationItems, getValue, getValues, initializeContextSource, initializeMinimalContextSource, isEmpty, isRolesDisabled, pageSearchResults, postprocessGroups, removeGroupAttributes, removeUserAttributes, searchEntities, searchEntitiesWithRequestControls, searchGroupObjects, searchGroupObjectsOfSpecifiedGroupType, searchGroupRelationships, searchGroups, searchUserObjects, searchUsers, setAttributes, setDirectoryId, setLdapPropertiesMapperAttributes, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsSettingEncryptedCredential, testConnection, typedEntityNotFoundException, updateUserCredential
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateUserFromRemoteDirectory, userAuthenticated
public Rfc2307(LDAPQueryTranslater ldapQueryTranslater, com.atlassian.event.api.EventPublisher eventPublisher, InstanceFactory instanceFactory, PasswordEncoderFactory passwordEncoderFactory)
public static String getStaticDirectoryType()
protected LDAPCredentialEncoder getCredentialEncoder()
getCredentialEncoder
in class SpringLDAPConnector
protected void getNewUserDirectorySpecificAttributes(User user, Attributes attributes)
SpringLDAPConnector
Overrider of this method can take advantage of the default group attributes mapping logic in {#getNewUserAttributes(User)}.
Note that the attribute values supplied here will be used raw. This entails that overrider is responsible for supplying values in a format supported by the directory. In some directory implementations, for example, a blank string ("") is considered illegal. Overrider thus would have to make sure the method does not generate a value as such.
getNewUserDirectorySpecificAttributes
in class SpringLDAPConnector
user
- (potential) source of information that needs to be added.attributes
- attributes to add directory-specific information to.public String getDescriptiveName()
RemoteDirectory
public void addUserToGroup(String username, String groupName) throws UserNotFoundException, GroupNotFoundException, OperationFailedException
RemoteDirectory
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.UserNotFoundException
- If the user cannot be found.GroupNotFoundException
- If the group cannot be found.OperationFailedException
- underlying directory implementation failed to execute the operation.public void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, OperationFailedException
RemoteDirectory
childGroup
- The group that will become a member of parentGroup
parentGroup
- The group that will gain a new memberGroupNotFoundException
- One or both of the groups cannot be found.OperationFailedException
- underlying directory implementation failed to execute the operation.public void removeUserFromGroup(String username, String groupName) throws UserNotFoundException, GroupNotFoundException, MembershipNotFoundException, OperationFailedException
RemoteDirectory
username
- The user that will be removed from parentGroup
groupName
- The group that will lose the member.UserNotFoundException
- If the user cannot be found.GroupNotFoundException
- If the group cannot be found.MembershipNotFoundException
- if the user is not a direct member of the group.OperationFailedException
- underlying directory implementation failed to execute the operation.public void removeGroupFromGroup(String childGroup, String parentGroup) throws GroupNotFoundException, MembershipNotFoundException, OperationFailedException
RemoteDirectory
childGroup
- The group that will be removed from parentGroup
parentGroup
- The group that will lose the member.GroupNotFoundException
- One or both of the groups cannot be found.MembershipNotFoundException
- if the childGroup is not a direct member of the parentGroup.OperationFailedException
- underlying directory implementation failed to execute the operation.public LDAPUserWithAttributes addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
SpringLDAPConnector
addUser
in interface RemoteDirectory
addUser
in class SpringLDAPConnector
user
- template of the user to add.credential
- password.InvalidUserException
- if the user to create was deemed invalid by the LDAP server or already exists.InvalidCredentialException
- if the password credential was deemed invalid by the password encoder.OperationFailedException
- if we were unable to add the user to LDAP.RemoteDirectory.supportsSettingEncryptedCredential()
public LDAPUserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
SpringLDAPConnector
addUser
in interface RemoteDirectory
addUser
in class SpringLDAPConnector
user
- template of the user to add.credential
- password.InvalidUserException
- if the user to create was deemed invalid by the LDAP server or already exists.InvalidCredentialException
- if the password credential was deemed invalid by the password encoder.OperationFailedException
- if we were unable to add the user to LDAP.RemoteDirectory.supportsSettingEncryptedCredential()
public Group addGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException
RemoteDirectory
group
to the directory store.addGroup
in interface RemoteDirectory
addGroup
in class SpringLDAPConnector
group
- template of the group to add.InvalidGroupException
- The supplied group is invalid or it already exists in the directory.OperationFailedException
- underlying directory implementation failed to execute the operation.public Group renameGroup(String oldName, String newName) throws GroupNotFoundException, InvalidGroupException, OperationFailedException
RemoteDirectory
group
.renameGroup
in interface RemoteDirectory
renameGroup
in class SpringLDAPConnector
oldName
- name of existing group.newName
- desired name of group.GroupNotFoundException
- if the group with the existing name does not exist.InvalidGroupException
- if the new group name is invalid or already exists in the directory.OperationFailedException
- if the underlying directory implementation failed to execute the operation.public User renameUser(String oldName, String newName) throws UserNotFoundException, InvalidUserException, OperationFailedException
RemoteDirectory
user
.renameUser
in interface RemoteDirectory
renameUser
in class SpringLDAPConnector
oldName
- name of existing user.newName
- desired name of user.UserNotFoundException
- if the user with the existing name does not exist.InvalidUserException
- if the new username is invalid.OperationFailedException
- if the underlying directory implementation failed to execute the operation.public Group updateGroup(GroupTemplate group) throws GroupNotFoundException, OperationFailedException
RemoteDirectory
group
.updateGroup
in interface RemoteDirectory
updateGroup
in class SpringLDAPConnector
group
- The group to update.GroupNotFoundException
- the group does not exist in the directory store.OperationFailedException
- underlying directory implementation failed to execute the operation.public User updateUser(UserTemplate user) throws UserNotFoundException, OperationFailedException
RemoteDirectory
user
.updateUser
in interface RemoteDirectory
updateUser
in class SpringLDAPConnector
user
- The user to update.UserNotFoundException
- the user does not exist in the directory store.OperationFailedException
- underlying directory implementation failed to execute the operation.public void removeUser(String name) throws UserNotFoundException, OperationFailedException
RemoteDirectory
user
that matches the supplied name
.removeUser
in interface RemoteDirectory
removeUser
in class SpringLDAPConnector
name
- The name of the user (username).UserNotFoundException
- The user does not exist.OperationFailedException
- underlying directory implementation failed to execute the operation.public void removeGroup(String name) throws GroupNotFoundException, OperationFailedException
RemoteDirectory
group
that matches the supplied name
.removeGroup
in interface RemoteDirectory
removeGroup
in class SpringLDAPConnector
name
- The name of the group.GroupNotFoundException
- The group does not exist.OperationFailedException
- underlying directory implementation failed to execute the operation.Copyright © 2020 Atlassian. All rights reserved.