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
public class Rfc2307
- extends RFC2307Directory
This class provides read-only support for the POSIX LDAP Schema (RFC2307)
| Methods inherited from class com.atlassian.crowd.directory.SpringLDAPConnector |
addDefaultSnToUserAttributes, addDefaultValueToUserAttributesForAttribute, asLdapGroupName, asLdapName, asLdapUserName, authenticate, createModificationItem, findEntityByDN, findEntityByDN, findGroupByName, findGroupByNameAndType, findGroupWithAttributesByName, findUserByExternalId, findUserByName, findUserWithAttributesByName, getAttributeAsBoolean, getAttributeAsLong, getAuthoritativeDirectory, getBaseEnvironmentProperties, getContextSource, getDirectoryId, getGroupContextMapper, getInitialGroupMemberDN, getKeys, getLdapPropertiesMapper, getNewGroupAttributes, getNewGroupDirectorySpecificAttributes, getNewUserAttributes, getSearchDN, getStandardisedDN, getSubTreeSearchControls, getUserContextMapper, getUserModificationItems, getValue, getValues, isEmpty, isRolesDisabled, pageSearchResults, postprocessGroups, removeGroupAttributes, removeUserAttributes, searchEntities, searchEntitiesWithRequestControls, searchGroupObjects, searchGroupObjectsOfSpecifiedGroupType, searchGroupRelationships, searchGroups, searchUserObjects, searchUsers, setAttributes, setDirectoryId, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, testConnection, typedEntityNotFoundException, updateUserCredential |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Rfc2307
public Rfc2307(LDAPQueryTranslater ldapQueryTranslater,
com.atlassian.event.api.EventPublisher eventPublisher,
InstanceFactory instanceFactory,
PasswordEncoderFactory passwordEncoderFactory)
getStaticDirectoryType
public static String getStaticDirectoryType()
encodePassword
protected String encodePassword(PasswordCredential passwordCredential)
- Translates a clear-text password into an encrypted one if it isn't already encrypted, using the encryption method
specified by the directory settings.
- Specified by:
encodePassword in class SpringLDAPConnector
- Parameters:
passwordCredential - The password credential to be encoded, guaranteed to be non-null. If the subclass
supports encrypting the given passwordCredential, it should NOT do so if
PasswordCredential.isEncryptedCredential()
returns true (although it may still encode the credential to the format
required by the directory). The value of
PasswordCredential.getCredential() is also
guaranteed to be non-null.
- Returns:
- An encoded password, suitable for passing to the directory.
- Throws:
PasswordEncoderNotFoundException - (runtime exception) if the encoder for the
specified encryption method cannot be found
getNewUserDirectorySpecificAttributes
protected void getNewUserDirectorySpecificAttributes(User user,
Attributes attributes)
- Description copied from class:
SpringLDAPConnector
- Populates 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:
getNewUserDirectorySpecificAttributes in class SpringLDAPConnector
- Parameters:
user - (potential) source of information that needs to be added.attributes - attributes to add directory-specific information to.
getDescriptiveName
public String getDescriptiveName()
addUserToGroup
public void addUserToGroup(String username,
String groupName)
throws UserNotFoundException,
GroupNotFoundException,
OperationFailedException
- Throws:
UserNotFoundException
GroupNotFoundException
OperationFailedException
addGroupToGroup
public void addGroupToGroup(String childGroup,
String parentGroup)
throws GroupNotFoundException,
OperationFailedException
- Throws:
GroupNotFoundException
OperationFailedException
removeUserFromGroup
public void removeUserFromGroup(String username,
String groupName)
throws UserNotFoundException,
GroupNotFoundException,
MembershipNotFoundException,
OperationFailedException
- Throws:
UserNotFoundException
GroupNotFoundException
MembershipNotFoundException
OperationFailedException
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup,
String parentGroup)
throws GroupNotFoundException,
MembershipNotFoundException,
OperationFailedException
- Throws:
GroupNotFoundException
MembershipNotFoundException
OperationFailedException
addUser
public LDAPUserWithAttributes addUser(UserTemplate user,
PasswordCredential credential)
throws InvalidUserException,
InvalidCredentialException,
OperationFailedException
- Description copied from class:
SpringLDAPConnector
- Adds a user to LDAP.
If the displayName on the user is blank, then the
- Specified by:
addUser in interface RemoteDirectory- Overrides:
addUser in class SpringLDAPConnector
- 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
public Group addGroup(GroupTemplate group)
throws InvalidGroupException,
OperationFailedException
- Specified by:
addGroup in interface RemoteDirectory- Overrides:
addGroup in class SpringLDAPConnector
- Throws:
InvalidGroupException
OperationFailedException
renameGroup
public Group renameGroup(String oldName,
String newName)
throws GroupNotFoundException,
InvalidGroupException,
OperationFailedException
- Specified by:
renameGroup in interface RemoteDirectory- Overrides:
renameGroup in class SpringLDAPConnector
- Throws:
GroupNotFoundException
InvalidGroupException
OperationFailedException
renameUser
public User renameUser(String oldName,
String newName)
throws UserNotFoundException,
InvalidUserException,
OperationFailedException
- Specified by:
renameUser in interface RemoteDirectory- Overrides:
renameUser in class SpringLDAPConnector
- Throws:
UserNotFoundException
InvalidUserException
OperationFailedException
updateGroup
public Group updateGroup(GroupTemplate group)
throws GroupNotFoundException,
OperationFailedException
- Specified by:
updateGroup in interface RemoteDirectory- Overrides:
updateGroup in class SpringLDAPConnector
- Throws:
GroupNotFoundException
OperationFailedException
updateUser
public User updateUser(UserTemplate user)
throws UserNotFoundException,
OperationFailedException
- Specified by:
updateUser in interface RemoteDirectory- Overrides:
updateUser in class SpringLDAPConnector
- Throws:
UserNotFoundException
OperationFailedException
removeUser
public void removeUser(String name)
throws UserNotFoundException,
OperationFailedException
- Specified by:
removeUser in interface RemoteDirectory- Overrides:
removeUser in class SpringLDAPConnector
- Throws:
UserNotFoundException
OperationFailedException
removeGroup
public void removeGroup(String name)
throws GroupNotFoundException,
OperationFailedException
- Specified by:
removeGroup in interface RemoteDirectory- Overrides:
removeGroup in class SpringLDAPConnector
- Throws:
GroupNotFoundException
OperationFailedException
Copyright © 2014 Atlassian. All Rights Reserved.