com.atlassian.crowd.integration.directory.connector
Class Rfc2307

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.connector.SpringLDAPConnector
      extended by com.atlassian.crowd.integration.directory.connector.RFC2307Directory
          extended by com.atlassian.crowd.integration.directory.connector.Rfc2307
All Implemented Interfaces:
LDAPDirectory, RemoteDirectory, AttributeAware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AppleOpenDirectory, FedoraDS, OpenLDAPRfc2307

public class Rfc2307
extends RFC2307Directory

This class provides read-only support for the POSIX LDAP Schema (RFC2307)


Field Summary
 
Fields inherited from class com.atlassian.crowd.integration.directory.connector.SpringLDAPConnector
applicationContext, attributes, contextSource, DEFAULT_PAGE_SIZE, eventManager, ldapPropertiesMapper, ldapQueryTranslater, ldapTemplate, logger, nameConverter, searchDN
 
Constructor Summary
Rfc2307()
           
 
Method Summary
 Group addGroup(GroupTemplate group)
          Adds a group to the directory store.
 void addGroupToGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Adds a group as a member of a parent group.
 LDAPUserWithAttributes addUser(UserTemplate user, PasswordCredential credential)
          Adds a user to the directory store.
 void addUserToGroup(java.lang.String username, java.lang.String groupName)
          Adds a user as a member of a group.
protected  java.lang.String encodePassword(java.lang.String unencodedPassword)
          Translates a clear-text password into an encrypted one, based on the directory settings.
 java.lang.String getDescriptiveName()
          Returns a descriptive name for the type of directory.
protected  void getNewUserDirectorySpecificAttributes(User user, javax.naming.directory.Attributes attributes)
          Overridden by sub-classes to add any additional attributes they need when creating a new user.
static java.lang.String getStaticDirectoryType()
           
 void removeGroup(java.lang.String name)
          Removes the group that matches the supplied name.
 void removeGroupFromGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Removes a group as a member of a parent group.
 void removeUser(java.lang.String name)
          Removes the user that matches the supplied name.
 void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
          Removes a user as a member of a group.
 Group renameGroup(java.lang.String oldName, java.lang.String newName)
          Renames a group.
 User renameUser(java.lang.String oldName, java.lang.String newName)
          Renames a user.
 Group updateGroup(GroupTemplate group)
          Updates the group.
 User updateUser(UserTemplate user)
          Updates the user.
 
Methods inherited from class com.atlassian.crowd.integration.directory.connector.RFC2307Directory
getCustomGroupAttributeMappers, getCustomUserAttributeMappers, isGroupDirectGroupMember, isUserDirectGroupMember, searchGroupRelationshipsWithGroupTypeSpecified, supportsNestedGroups
 
Methods inherited from class com.atlassian.crowd.integration.directory.connector.SpringLDAPConnector
addDefaultSnToUserAttributes, addDefaultValueToUserAttributesForAttribute, asLdapName, authenticate, findEntityByDN, findEntityByDN, findGroupByName, findGroupByNameAndType, findGroupWithAttributesByName, findUserByName, findUserWithAttributesByName, getAttribute, getAttributeAsBoolean, getAttributeAsLong, getAttributeNames, getAttributes, getBaseEnvironmentProperties, getContextSource, getDirectoryId, getEncoder, getGroupContextMapper, getInitialGroupMemberDN, getLdapPropertiesMapper, getNewGroupAttributes, getNewGroupDirectorySpecificAttributes, getNewUserAttributes, getSearchDN, getStandardisedDN, getSubTreeSearchControl, getUserContextMapper, hasAttribute, pageSearchResults, removeGroupAttributes, removeUserAttributes, searchEntities, searchEntitiesWithRequestControls, searchGroupObjects, searchGroupObjectsOfSpecifiedGroupType, searchGroupRelationships, searchGroups, searchUserObjects, searchUsers, setApplicationContext, setAttributes, setDirectoryId, setEventManager, setLdapQueryTranslater, storeGroupAttributes, storeUserAttributes, testConnection, updateUserCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rfc2307

public Rfc2307()
Method Detail

getStaticDirectoryType

public static java.lang.String getStaticDirectoryType()

encodePassword

protected java.lang.String encodePassword(java.lang.String unencodedPassword)
Translates a clear-text password into an encrypted one, based on the directory settings.

Specified by:
encodePassword in class SpringLDAPConnector
Parameters:
unencodedPassword - password
Returns:
encoded password

getNewUserDirectorySpecificAttributes

protected void getNewUserDirectorySpecificAttributes(User user,
                                                     javax.naming.directory.Attributes attributes)
Description copied from class: SpringLDAPConnector
Overridden by sub-classes to add any additional attributes they need when creating a new user. addBlankSnToUserAttributes.

Overrides:
getNewUserDirectorySpecificAttributes in class SpringLDAPConnector
Parameters:
user - The (potential) source of information that needs to be added
attributes - The attributes to add directory-specific information to

getDescriptiveName

public java.lang.String getDescriptiveName()
Description copied from interface: RemoteDirectory
Returns a descriptive name for the type of directory.

Returns:
descriptive name.

addUserToGroup

public void addUserToGroup(java.lang.String username,
                           java.lang.String groupName)
                    throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Adds a user as a member of a group. This means that all user members of childGroup will appear as members of parentGroup to querying applications.

Parameters:
username - The user that will become a member of groupName
groupName - The group that will gain a new member.
Throws:
ObjectNotFoundException - If the user or group cannot be found.

addGroupToGroup

public void addGroupToGroup(java.lang.String childGroup,
                            java.lang.String parentGroup)
                     throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Adds a group as a member of a parent group.

Parameters:
childGroup - The group that will become a member of parentGroup
parentGroup - The group that will gain a new member
Throws:
ObjectNotFoundException - One or both of the groups cannot be found.

removeUserFromGroup

public void removeUserFromGroup(java.lang.String username,
                                java.lang.String groupName)
                         throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Removes a user as a member of a group.

Parameters:
username - The user that will be removed from parentGroup
groupName - The group that will lose the member.
Throws:
ObjectNotFoundException - If either the user or group cannot be found.

removeGroupFromGroup

public void removeGroupFromGroup(java.lang.String childGroup,
                                 java.lang.String parentGroup)
                          throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Removes a group as a member of a parent group.

Parameters:
childGroup - The group that will be removed from parentGroup
parentGroup - The group that will lose the member.
Throws:
ObjectNotFoundException - One or both of the groups cannot be found.

addUser

public LDAPUserWithAttributes addUser(UserTemplate user,
                                      PasswordCredential credential)
                               throws InvalidUserException,
                                      InvalidCredentialException,
                                      ObjectNotFoundException
Description copied from interface: RemoteDirectory
Adds a user to the directory store.

Specified by:
addUser in interface RemoteDirectory
Overrides:
addUser in class SpringLDAPConnector
Parameters:
user - template of the user to add.
credential - password. May be null, since JIRA creates a user in two steps (user THEN password)
Returns:
the added user retrieved from the underlying store.
Throws:
InvalidUserException - The supplied user is invalid.
InvalidCredentialException - The supplied credential is invalid.
ObjectNotFoundException - The user could not be looked up after creation or the directory with the ID of user.directoryId does not exist.

addGroup

public Group addGroup(GroupTemplate group)
               throws InvalidGroupException,
                      ObjectNotFoundException
Description copied from interface: RemoteDirectory
Adds a group to the directory store.

Specified by:
addGroup in interface RemoteDirectory
Overrides:
addGroup in class SpringLDAPConnector
Parameters:
group - template of the group to add.
Returns:
the added group retrieved from the underlying store.
Throws:
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.

renameGroup

public Group renameGroup(java.lang.String oldName,
                         java.lang.String newName)
                  throws ObjectNotFoundException,
                         InvalidGroupException
Description copied from interface: RemoteDirectory
Renames a group.

Specified by:
renameGroup in interface RemoteDirectory
Overrides:
renameGroup in class SpringLDAPConnector
Parameters:
oldName - name of existing group.
newName - desired name of group.
Returns:
renamed group.
Throws:
ObjectNotFoundException - if the group with the existing name does not exist.
InvalidGroupException - if the new groupname is invalid or already exists in the directory.

renameUser

public User renameUser(java.lang.String oldName,
                       java.lang.String newName)
                throws ObjectNotFoundException,
                       InvalidUserException
Description copied from interface: RemoteDirectory
Renames a user.

Specified by:
renameUser in interface RemoteDirectory
Overrides:
renameUser in class SpringLDAPConnector
Parameters:
oldName - name of existing user.
newName - desired name of user.
Returns:
renamed user.
Throws:
ObjectNotFoundException - if the user with the existing name does not exist.
InvalidUserException - if the new username is invalid or already exists in the directory.

updateGroup

public Group updateGroup(GroupTemplate group)
                  throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Updates the group.

Specified by:
updateGroup in interface RemoteDirectory
Overrides:
updateGroup in class SpringLDAPConnector
Parameters:
group - The group to update.
Returns:
the updated group retrieved from the underlying store.
Throws:
ObjectNotFoundException - the group does not exist in the directory store.

updateUser

public User updateUser(UserTemplate user)
                throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Updates the user.

Specified by:
updateUser in interface RemoteDirectory
Overrides:
updateUser in class SpringLDAPConnector
Parameters:
user - The user to update.
Returns:
the updated user retrieved from the underlying store.
Throws:
ObjectNotFoundException - the user does not exist in the directory store.

removeUser

public void removeUser(java.lang.String name)
                throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Removes the user that matches the supplied name.

Specified by:
removeUser in interface RemoteDirectory
Overrides:
removeUser in class SpringLDAPConnector
Parameters:
name - The name of the user (username).
Throws:
ObjectNotFoundException - The user does not exist.

removeGroup

public void removeGroup(java.lang.String name)
                 throws ObjectNotFoundException
Description copied from interface: RemoteDirectory
Removes the group that matches the supplied name.

Specified by:
removeGroup in interface RemoteDirectory
Overrides:
removeGroup in class SpringLDAPConnector
Parameters:
name - The name of the group.
Throws:
ObjectNotFoundException - The group does not exist.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.