Package com.atlassian.crowd.directory
Class Rfc2307
java.lang.Object
com.atlassian.crowd.directory.SpringLDAPConnector
com.atlassian.crowd.directory.RFC2307Directory
com.atlassian.crowd.directory.Rfc2307
- All Implemented Interfaces:
LDAPDirectory,RemoteDirectory,Attributes
- Direct Known Subclasses:
AppleOpenDirectory,FedoraDS,OpenLDAPRfc2307
This class provides read-only support for the POSIX LDAP Schema (RFC2307)
-
Field Summary
Fields inherited from class com.atlassian.crowd.directory.SpringLDAPConnector
attributes, contextSource, contextSourceTransactionManager, DEFAULT_PAGE_SIZE, eventPublisher, ldapPropertiesMapper, ldapQueryTranslater, ldapTemplate, nameConverter, searchDN -
Constructor Summary
ConstructorsConstructorDescriptionRfc2307(LDAPQueryTranslater ldapQueryTranslater, com.atlassian.event.api.EventPublisher eventPublisher, InstanceFactory instanceFactory, PasswordEncoderFactory passwordEncoderFactory, LdapContextSourceProvider ldapContextSourceProvider) -
Method Summary
Modifier and TypeMethodDescriptionaddGroup(GroupTemplate group) voidaddGroupToGroup(String childGroup, String parentGroup) addUser(UserTemplate user, PasswordCredential credential) Adds a user to LDAP.addUser(UserTemplateWithAttributes user, PasswordCredential credential) Adds a user to LDAP.voidaddUserToGroup(String username, String groupName) protected LDAPCredentialEncoderprotected voidgetNewUserDirectorySpecificAttributes(User user, Attributes attributes) Populates attributes object with directory-specific attributes.static StringvoidremoveGroup(String name) voidremoveGroupFromGroup(String childGroup, String parentGroup) voidremoveUser(String name) voidremoveUserFromGroup(String username, String groupName) renameGroup(String oldName, String newName) renameUser(String oldName, String newName) updateGroup(GroupTemplate group) updateUser(UserTemplate user) Methods inherited from class com.atlassian.crowd.directory.RFC2307Directory
getCustomGroupAttributeMappers, getCustomUserAttributeMappers, getMemberOnlyGroupAttributeMappers, getMemberships, isGroupDirectGroupMember, isUserDirectGroupMember, searchGroupRelationshipsWithGroupTypeSpecified, supportsNestedGroups, supportsPasswordExpirationMethods inherited from class com.atlassian.crowd.directory.SpringLDAPConnector
addDefaultSnToUserAttributes, addDefaultValueToUserAttributesForAttribute, authenticate, avatarMapper, countDirectMembersOfGroup, createModificationItem, expireAllPasswords, findEntityByDN, findEntityByDN, findEntityByDN, findGroupByName, findGroupByNameAndType, findGroupWithAttributesByName, findUserByExternalId, findUserByName, findUserWithAttributesByName, getAttributeAsBoolean, getAttributeAsLong, getAuthoritativeDirectory, getBaseEnvironmentProperties, getContextSource, getDirectoryId, getGroupContextMapper, getGroupContextMapper, getInitialGroupMemberDN, getKeys, getLdapPropertiesMapper, getNewGroupAttributes, getNewGroupDirectorySpecificAttributes, getNewUserAttributes, getRequiredCustomGroupAttributeMappers, getSearchControls, getSearchDN, getUserAvatarByName, getUserModificationItems, getValue, getValues, isEmpty, isRolesDisabled, pageSearchResults, postprocessGroup, postprocessGroups, removeGroupAttributes, removeUserAttributes, searchEntities, searchEntitiesWithRequestControls, searchGroupObjects, searchGroupObjectsOfSpecifiedGroupType, searchGroupRelationships, searchGroups, searchUserObjects, searchUsers, searchUsers, setAttributes, setDirectoryId, setLdapPropertiesMapperAttributes, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsSettingEncryptedCredential, testConnection, typedEntityNotFoundException, updateUserCredentialMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.crowd.directory.RemoteDirectory
getLocallyFilteredGroupNames, updateUserFromRemoteDirectory, userAuthenticated
-
Constructor Details
-
Rfc2307
public Rfc2307(LDAPQueryTranslater ldapQueryTranslater, com.atlassian.event.api.EventPublisher eventPublisher, InstanceFactory instanceFactory, PasswordEncoderFactory passwordEncoderFactory, LdapContextSourceProvider ldapContextSourceProvider)
-
-
Method Details
-
getStaticDirectoryType
-
getCredentialEncoder
- Specified by:
getCredentialEncoderin classSpringLDAPConnector- Returns:
- the credential encoder to use with this directory; must not be null.
-
getNewUserDirectorySpecificAttributes
Description copied from class:SpringLDAPConnectorPopulates attributes object with directory-specific attributes.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.
- Overrides:
getNewUserDirectorySpecificAttributesin classSpringLDAPConnector- Parameters:
user- (potential) source of information that needs to be added.attributes- attributes to add directory-specific information to.
-
getDescriptiveName
-
addUserToGroup
public void addUserToGroup(String username, String groupName) throws UserNotFoundException, GroupNotFoundException, OperationFailedException -
addGroupToGroup
public void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, OperationFailedException -
removeUserFromGroup
public void removeUserFromGroup(String username, String groupName) throws UserNotFoundException, GroupNotFoundException, MembershipNotFoundException, OperationFailedException -
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup, String parentGroup) throws GroupNotFoundException, MembershipNotFoundException, OperationFailedException -
addUser
public LDAPUserWithAttributes addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException Description copied from class:SpringLDAPConnectorAdds a user to LDAP.- Specified by:
addUserin interfaceRemoteDirectory- Overrides:
addUserin classSpringLDAPConnector- Parameters:
user- template of the user to add.credential- password.- Returns:
- LDAP user retrieved from LDAP after successfully adding the user to LDAP.
- Throws:
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.
-
addUser
public LDAPUserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException Description copied from class:SpringLDAPConnectorAdds a user to LDAP.- Specified by:
addUserin interfaceRemoteDirectory- Overrides:
addUserin classSpringLDAPConnector- Parameters:
user- template of the user to add.credential- password.- Returns:
- LDAP user retrieved from LDAP after successfully adding the user to LDAP.
- Throws:
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.
-
addGroup
- Specified by:
addGroupin interfaceRemoteDirectory- Overrides:
addGroupin classSpringLDAPConnector- Throws:
InvalidGroupExceptionOperationFailedException
-
renameGroup
public Group renameGroup(String oldName, String newName) throws GroupNotFoundException, InvalidGroupException, OperationFailedException - Specified by:
renameGroupin interfaceRemoteDirectory- Overrides:
renameGroupin classSpringLDAPConnector- Throws:
GroupNotFoundExceptionInvalidGroupExceptionOperationFailedException
-
renameUser
public User renameUser(String oldName, String newName) throws UserNotFoundException, InvalidUserException, OperationFailedException - Specified by:
renameUserin interfaceRemoteDirectory- Overrides:
renameUserin classSpringLDAPConnector- Throws:
UserNotFoundExceptionInvalidUserExceptionOperationFailedException
-
updateGroup
public Group updateGroup(GroupTemplate group) throws GroupNotFoundException, OperationFailedException - Specified by:
updateGroupin interfaceRemoteDirectory- Overrides:
updateGroupin classSpringLDAPConnector- Throws:
GroupNotFoundExceptionOperationFailedException
-
updateUser
- Specified by:
updateUserin interfaceRemoteDirectory- Overrides:
updateUserin classSpringLDAPConnector- Throws:
UserNotFoundExceptionOperationFailedException
-
removeUser
- Specified by:
removeUserin interfaceRemoteDirectory- Overrides:
removeUserin classSpringLDAPConnector- Throws:
UserNotFoundExceptionOperationFailedException
-
removeGroup
- Specified by:
removeGroupin interfaceRemoteDirectory- Overrides:
removeGroupin classSpringLDAPConnector- Throws:
GroupNotFoundExceptionOperationFailedException
-