public abstract class SpringLDAPConnector extends Object implements LDAPDirectory
Warning: CWD-2494: When read timeout is enabled, operations can fail randomly with "javax.naming.NamingException: LDAP response read timed out..." error message without waiting for the timeout to pass.
| Modifier and Type | Field and Description |
|---|---|
protected AttributeValuesHolder |
attributes |
protected org.springframework.ldap.core.ContextSource |
contextSource |
protected org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManager |
contextSourceTransactionManager |
static int |
DEFAULT_PAGE_SIZE |
protected com.atlassian.event.api.EventPublisher |
eventPublisher |
protected LDAPPropertiesMapper |
ldapPropertiesMapper |
protected LDAPQueryTranslater |
ldapQueryTranslater |
protected SpringLdapTemplateWrapper |
ldapTemplate |
protected Converter |
nameConverter |
protected SearchDN |
searchDN |
| Constructor and Description |
|---|
SpringLDAPConnector(LDAPQueryTranslater ldapQueryTranslater,
com.atlassian.event.api.EventPublisher eventPublisher,
InstanceFactory instanceFactory,
LdapContextSourceProvider ldapContextSourceProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDefaultSnToUserAttributes(Attributes attrs,
String defaultSnValue)
A default install of many directory servers (inc.
|
protected void |
addDefaultValueToUserAttributesForAttribute(String attributeName,
Attributes attrs,
String defaultValue) |
Group |
addGroup(GroupTemplate group) |
LDAPUserWithAttributes |
addUser(UserTemplate user,
PasswordCredential credential)
Adds a user to LDAP.
|
LDAPUserWithAttributes |
addUser(UserTemplateWithAttributes user,
PasswordCredential credential)
Adds a user to LDAP.
|
protected LdapName |
asLdapGroupName(String dn,
String groupName)
Convenience method to convert group DN to LdapName,
throwing a GNFE with the supplied group name if unable
to construct the LdapName.
|
protected <T extends LDAPDirectoryEntity> |
asLdapName(String dn,
String entityName,
Class<T> entityClass)
This method is required to wrap DN's into LdapNames as spring-ldap
doesn't correctly handle operations with String dn arguments.
|
protected LdapName |
asLdapUserName(String dn,
String userName)
Convenience method to convert user DN to LdapName,
throwing a GNFE with the supplied user name if unable
to construct the LdapName.
|
User |
authenticate(String name,
PasswordCredential credential) |
protected ContextMapperWithRequiredAttributes<AvatarReference.BlobAvatar> |
avatarMapper() |
BoundedCount |
countDirectMembersOfGroup(String groupName,
int querySizeHint) |
protected static ModificationItem |
createModificationItem(String directoryAttributeName,
String oldValue,
String newValue)
This method is not suitable for generic attribute updates as it only supports single
attribute-value mappings (ie.
|
void |
expireAllPasswords() |
<T extends LDAPDirectoryEntity> |
findEntityByDN(String dn,
Class<T> entityClass)
Finds a directory entity (principal, group or role)
by their distinguished name.
|
protected <T extends LDAPDirectoryEntity> |
findEntityByDN(String dn,
String baseDN,
String filter,
ContextMapperWithRequiredAttributes contextMapper,
Class<T> entityClass) |
LDAPGroupWithAttributes |
findGroupByName(String name) |
protected LDAPGroupWithAttributes |
findGroupByNameAndType(String name,
GroupType groupType) |
LDAPGroupWithAttributes |
findGroupWithAttributesByName(String name) |
LDAPUserWithAttributes |
findUserByExternalId(String externalId) |
LDAPUserWithAttributes |
findUserByName(String name) |
LDAPUserWithAttributes |
findUserWithAttributesByName(String name) |
boolean |
getAttributeAsBoolean(String name,
boolean defaultValue) |
long |
getAttributeAsLong(String name,
long defaultValue) |
RemoteDirectory |
getAuthoritativeDirectory() |
protected Map<String,Object> |
getBaseEnvironmentProperties()
Returns the properties used to set up the Ldap ContextSource.
|
org.springframework.ldap.core.ContextSource |
getContextSource()
Exposed so that delegated directories can get a handle on the underlying LDAP context.
|
protected abstract LDAPCredentialEncoder |
getCredentialEncoder() |
protected List<AttributeMapper> |
getCustomGroupAttributeMappers()
As a minimum, this SHOULD provide an attribute mapper that maps the group members attribute (if available).
|
protected List<AttributeMapper> |
getCustomUserAttributeMappers(UserContextMapperConfig config) |
long |
getDirectoryId() |
ContextMapperWithRequiredAttributes<LDAPGroupWithAttributes> |
getGroupContextMapper(GroupType groupType,
boolean withAllAttributes)
Returns a ContextMapper ready to translate LDAP objects into Groups.
|
protected String |
getInitialGroupMemberDN()
Returns the default container member DN.
|
Set<String> |
getKeys() |
LDAPPropertiesMapper |
getLdapPropertiesMapper() |
protected Attributes |
getNewGroupAttributes(Group group) |
protected void |
getNewGroupDirectorySpecificAttributes(Group group,
Attributes attributes)
Populates attributes object with directory-specific attributes.
|
protected Attributes |
getNewUserAttributes(User user,
PasswordCredential credential)
Translates the
User into LDAP attributes, in preparation for creating a new user. |
protected void |
getNewUserDirectorySpecificAttributes(User user,
Attributes attributes)
Populates attributes object with directory-specific attributes.
|
protected List<AttributeMapper> |
getRequiredCustomGroupAttributeMappers()
Returns a set of attributes which are expected to be present in all cases (ie Active Directory's objectGUID)
Due to performance reasons returning mappers for heavy attributes (such as memberships) should be avoided
|
protected SearchControls |
getSearchControls(ContextMapperWithRequiredAttributes<?> mapper,
int scope) |
SearchDN |
getSearchDN() |
AvatarReference.BlobAvatar |
getUserAvatarByName(String username,
int sizeHint) |
protected List<ModificationItem> |
getUserModificationItems(User userTemplate,
LDAPUserWithAttributes currentUser) |
String |
getValue(String name) |
Set<String> |
getValues(String name) |
boolean |
isEmpty() |
boolean |
isRolesDisabled() |
protected org.springframework.ldap.core.CollectingNameClassPairCallbackHandler |
pageSearchResults(Name baseDN,
String filter,
org.springframework.ldap.core.ContextMapper contextMapper,
SearchControls searchControls,
org.springframework.ldap.core.DirContextProcessor ldapRequestControls,
int maxResults)
Performs a paged results search on an LDAP directory server searching using the LDAP paged results control
option to fetch results in chunks rather than all at once.
|
protected List<LDAPGroupWithAttributes> |
postprocessGroups(List<LDAPGroupWithAttributes> groups)
Perform any post-processing on groups.
|
void |
removeGroup(String name) |
void |
removeGroupAttributes(String groupName,
String attributeName) |
void |
removeUser(String name) |
void |
removeUserAttributes(String username,
String attributeName) |
Group |
renameGroup(String oldName,
String newName) |
User |
renameUser(String oldName,
String newName) |
protected <T> List<T> |
searchEntities(Name baseDN,
String filter,
ContextMapperWithRequiredAttributes<T> contextMapper,
int startIndex,
int maxResults)
Executes a search with paging if paged results is supported.
|
protected <T> List<T> |
searchEntitiesWithRequestControls(Name baseDN,
String filter,
ContextMapperWithRequiredAttributes<T> contextMapper,
SearchControls searchControls,
org.springframework.ldap.core.DirContextProcessor ldapRequestControls,
int startIndex,
int maxResults) |
<T> List<T> |
searchGroupObjects(EntityQuery<?> query,
ContextMapperWithRequiredAttributes<T> mapper) |
protected <T> List<T> |
searchGroupObjectsOfSpecifiedGroupType(EntityQuery<?> query,
ContextMapperWithRequiredAttributes<T> mapper)
This method expects that the query contains a non-null groupType in the entityDescriptor.
|
<T> List<T> |
searchGroupRelationships(MembershipQuery<T> query) |
protected abstract <T> Iterable<T> |
searchGroupRelationshipsWithGroupTypeSpecified(MembershipQuery<T> query)
Execute the search for group relationships given that a group of type GROUP or LEGACY_ROLE has
been specified in the EntityDescriptor for the group(s).
|
<T> List<T> |
searchGroups(EntityQuery<T> query) |
<T> List<T> |
searchUserObjects(EntityQuery<?> query,
ContextMapperWithRequiredAttributes<T> mapper) |
<T> List<T> |
searchUsers(EntityQuery<T> query) |
void |
setAttributes(Map<String,String> attributes)
Called by the
DirectoryInstanceLoader after
constructing an InternalDirectory. |
void |
setDirectoryId(long id)
Called by the
DirectoryInstanceLoader after
constructing an InternalDirectory. |
protected void |
setLdapPropertiesMapperAttributes(Map<String,String> attributes) |
void |
storeGroupAttributes(String groupName,
Map<String,Set<String>> attributes) |
void |
storeUserAttributes(String username,
Map<String,Set<String>> attributes) |
boolean |
supportsInactiveAccounts()
Storing active/inactive flag for users in LDAP in general is currently not supported.
|
boolean |
supportsNestedGroups() |
boolean |
supportsPasswordExpiration()
We don't support expiring passwords in LDAP directories (yet).
|
boolean |
supportsSettingEncryptedCredential() |
void |
testConnection() |
protected <T extends LDAPDirectoryEntity> |
typedEntityNotFoundException(String name,
Class<T> entityClass) |
Group |
updateGroup(GroupTemplate group) |
User |
updateUser(UserTemplate user) |
void |
updateUserCredential(String name,
PasswordCredential credential) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddGroupToGroup, addUserToGroup, getDescriptiveName, getLocallyFilteredGroupNames, getMemberships, isGroupDirectGroupMember, isUserDirectGroupMember, removeGroupFromGroup, removeUserFromGroup, updateUserFromRemoteDirectory, userAuthenticatedpublic static final int DEFAULT_PAGE_SIZE
protected volatile AttributeValuesHolder attributes
protected volatile SpringLdapTemplateWrapper ldapTemplate
protected volatile org.springframework.ldap.core.ContextSource contextSource
protected volatile Converter nameConverter
protected volatile SearchDN searchDN
protected volatile LDAPPropertiesMapper ldapPropertiesMapper
protected volatile org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManager contextSourceTransactionManager
protected final LDAPQueryTranslater ldapQueryTranslater
protected final com.atlassian.event.api.EventPublisher eventPublisher
public SpringLDAPConnector(LDAPQueryTranslater ldapQueryTranslater, com.atlassian.event.api.EventPublisher eventPublisher, InstanceFactory instanceFactory, LdapContextSourceProvider ldapContextSourceProvider)
public BoundedCount countDirectMembersOfGroup(String groupName, int querySizeHint) throws OperationFailedException
countDirectMembersOfGroup in interface RemoteDirectoryOperationFailedExceptionpublic long getDirectoryId()
getDirectoryId in interface RemoteDirectorypublic void setDirectoryId(long id)
DirectoryInstanceLoader after
constructing an InternalDirectory.setDirectoryId in interface RemoteDirectoryid - The unique id of the Directory stored in the database.public void setAttributes(Map<String,String> attributes)
DirectoryInstanceLoader after
constructing an InternalDirectory.setAttributes in interface RemoteDirectoryattributes - attributes map.protected void setLdapPropertiesMapperAttributes(Map<String,String> attributes)
public org.springframework.ldap.core.ContextSource getContextSource()
public LDAPPropertiesMapper getLdapPropertiesMapper()
public Set<String> getValues(String name)
getValues in interface Attributespublic String getValue(String name)
getValue in interface Attributespublic boolean isEmpty()
isEmpty in interface Attributespublic long getAttributeAsLong(String name, long defaultValue)
public boolean getAttributeAsBoolean(String name, boolean defaultValue)
public Set<String> getKeys()
getKeys in interface Attributespublic SearchDN getSearchDN()
protected SearchControls getSearchControls(ContextMapperWithRequiredAttributes<?> mapper, int scope)
protected Map<String,Object> getBaseEnvironmentProperties()
protected org.springframework.ldap.core.CollectingNameClassPairCallbackHandler pageSearchResults(Name baseDN, String filter, org.springframework.ldap.core.ContextMapper contextMapper, SearchControls searchControls, org.springframework.ldap.core.DirContextProcessor ldapRequestControls, int maxResults) throws OperationFailedException
baseDN - The DN to beging the search from.filter - The search filter.contextMapper - Maps from LDAP search results into objects such as Groups.searchControls - The LDAP search scope type.ldapRequestControls - Any LDAP request controls (set to null if you do not need additional request controls for the search).maxResults - maximum number of results to return. Set to -1 if no result limiting is desired (WARNING: doing so is obviously a hazard).OperationFailedException - Search failed due to a communication error to the remote directoryprotected <T> List<T> searchEntities(Name baseDN, String filter, ContextMapperWithRequiredAttributes<T> contextMapper, int startIndex, int maxResults) throws OperationFailedException
baseDN - base DN of search.filter - encoded LDAP search filter.contextMapper - directory context to object mapper.startIndex - index to start at. Set to 0 to start from the first result.maxResults - maximum number of results to return. Set to -1 if no result limiting is desired (WARNING: doing so is obviously a hazard).OperationFailedException - a Communication error occurred when trying to talk to a remote directoryprotected <T> List<T> searchEntitiesWithRequestControls(Name baseDN, String filter, ContextMapperWithRequiredAttributes<T> contextMapper, SearchControls searchControls, org.springframework.ldap.core.DirContextProcessor ldapRequestControls, int startIndex, int maxResults) throws OperationFailedException
OperationFailedExceptionprotected static ModificationItem createModificationItem(String directoryAttributeName, String oldValue, String newValue)
directoryAttributeName - the name of the attribute in LDAP to potentially add or modify.oldValue - the value load from the LDAP directory (i.e. already processed by
DirectoryAttributeRetriever.fromSavedLDAPValue(String))newValue - the value which should be saved into LDAP (i.e. NOT processed by
DirectoryAttributeRetriever.toSaveableLDAPValue(String) yet)protected List<AttributeMapper> getCustomUserAttributeMappers(UserContextMapperConfig config)
public ContextMapperWithRequiredAttributes<LDAPGroupWithAttributes> getGroupContextMapper(GroupType groupType, boolean withAllAttributes)
groupType - the GroupTypewithAllAttributes - determines if all additional attribute mappers should be included. Some directories
may include additional attributes, which are expected to be present in all casesprotected List<AttributeMapper> getCustomGroupAttributeMappers()
protected List<AttributeMapper> getRequiredCustomGroupAttributeMappers()
public LDAPUserWithAttributes findUserByName(String name) throws UserNotFoundException, OperationFailedException
findUserByName in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic LDAPUserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException
findUserWithAttributesByName in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic LDAPUserWithAttributes findUserByExternalId(String externalId) throws UserNotFoundException, OperationFailedException
findUserByExternalId in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic <T> List<T> searchUserObjects(EntityQuery<?> query, ContextMapperWithRequiredAttributes<T> mapper) throws OperationFailedException, IllegalArgumentException
public void removeUser(String name) throws UserNotFoundException, OperationFailedException
removeUser in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic void updateUserCredential(String name, PasswordCredential credential) throws InvalidCredentialException, UserNotFoundException, OperationFailedException
updateUserCredential in interface RemoteDirectoryInvalidCredentialExceptionUserNotFoundExceptionOperationFailedExceptionpublic User renameUser(String oldName, String newName) throws UserNotFoundException, InvalidUserException, OperationFailedException
renameUser in interface RemoteDirectoryUserNotFoundExceptionInvalidUserExceptionOperationFailedExceptionpublic void storeUserAttributes(String username, Map<String,Set<String>> attributes) throws UserNotFoundException, OperationFailedException
storeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionpublic void removeUserAttributes(String username, String attributeName) throws UserNotFoundException, OperationFailedException
removeUserAttributes in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionprotected Attributes getNewUserAttributes(User user, PasswordCredential credential) throws InvalidCredentialException, org.springframework.ldap.NamingException
User into LDAP attributes, in preparation for creating a new user.user - The user object to translate into LDAP attributescredential - raw password.InvalidCredentialException - The password, if supplied, was invalid in some manner.org.springframework.ldap.NamingException - If the User could not be translated to an Attributesprotected void getNewUserDirectorySpecificAttributes(User user, Attributes 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.
user - (potential) source of information that needs to be added.attributes - attributes to add directory-specific information to.public LDAPUserWithAttributes addUser(UserTemplate user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
addUser in interface RemoteDirectoryuser - 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.public LDAPUserWithAttributes addUser(UserTemplateWithAttributes user, PasswordCredential credential) throws InvalidUserException, InvalidCredentialException, OperationFailedException
addUser in interface RemoteDirectoryuser - 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.protected void addDefaultSnToUserAttributes(Attributes attrs, String defaultSnValue)
objectClass -> inetorgperson cn -> sn ->If a call is being made from an external system (eg JIRA), the user is created with the bare minimum of attributes, then later updated. We need to make sure to add
sn if it's not present in the
information provided.attrs - The LDAP user attributes to be checked and potentially updated.defaultSnValue - default lastname/surname valueprotected void addDefaultValueToUserAttributesForAttribute(String attributeName, Attributes attrs, String defaultValue)
public <T extends LDAPDirectoryEntity> T findEntityByDN(String dn, Class<T> entityClass) throws UserNotFoundException, GroupNotFoundException, OperationFailedException
LDAPDirectoryThe object class of an entity is used to determine the entity type.
If an object represents both a group and role, then the object is mapped to a group.
findEntityByDN in interface LDAPDirectorydn - standardised distinguished name.entityClass - class of the entity to find (either LDAPUserWithAttributes or LDAPGroupWithAttributes).UserNotFoundException - if a user
does not exist at the specified DN or the DN does not
exist in the directory. This will also be thrown if
the entity DOES exist but does not match the base DN
or object filter for the entity type.GroupNotFoundException - if a user
does not exist at the specified DN or the DN does not
exist in the directory. This will also be thrown if
the entity DOES exist but does not match the base DN
or object filter for the entity type.OperationFailedException - if underlying directory implementation failed to execute the operation.protected <T extends LDAPDirectoryEntity> RuntimeException typedEntityNotFoundException(String name, Class<T> entityClass) throws UserNotFoundException, GroupNotFoundException
protected <T extends LDAPDirectoryEntity> T findEntityByDN(String dn, String baseDN, String filter, ContextMapperWithRequiredAttributes contextMapper, Class<T> entityClass) throws UserNotFoundException, GroupNotFoundException, OperationFailedException
public User updateUser(UserTemplate user) throws UserNotFoundException, OperationFailedException
updateUser in interface RemoteDirectoryUserNotFoundExceptionOperationFailedExceptionprotected List<ModificationItem> getUserModificationItems(User userTemplate, LDAPUserWithAttributes currentUser)
public <T> List<T> searchUsers(EntityQuery<T> query) throws OperationFailedException
searchUsers in interface RemoteDirectoryOperationFailedExceptionpublic User authenticate(String name, PasswordCredential credential) throws InvalidAuthenticationException, UserNotFoundException, OperationFailedException
authenticate in interface RemoteDirectoryInvalidAuthenticationExceptionUserNotFoundExceptionOperationFailedExceptionpublic LDAPGroupWithAttributes findGroupByName(String name) throws GroupNotFoundException, OperationFailedException
findGroupByName in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic LDAPGroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException
findGroupWithAttributesByName in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionprotected LDAPGroupWithAttributes findGroupByNameAndType(String name, GroupType groupType) throws GroupNotFoundException, OperationFailedException
protected <T> List<T> searchGroupObjectsOfSpecifiedGroupType(EntityQuery<?> query, ContextMapperWithRequiredAttributes<T> mapper) throws OperationFailedException
query - search query.OperationFailedException - represents a Communication error when trying to talk to a remote directorypublic <T> List<T> searchGroupObjects(EntityQuery<?> query, ContextMapperWithRequiredAttributes<T> mapper) throws OperationFailedException
OperationFailedExceptionpublic <T> List<T> searchGroups(EntityQuery<T> query) throws OperationFailedException
searchGroups in interface RemoteDirectoryOperationFailedExceptionprotected List<LDAPGroupWithAttributes> postprocessGroups(List<LDAPGroupWithAttributes> groups) throws OperationFailedException
groups - to post-processOperationFailedException - if processing encounters a problem with the underlying directoryprotected Attributes getNewGroupAttributes(Group group) throws org.springframework.ldap.NamingException
org.springframework.ldap.NamingExceptionprotected void getNewGroupDirectorySpecificAttributes(Group group, Attributes attributes)
Overrider of this method can take advantage of the default group attributes mapping logic in {#getNewGroupAttributes(Group)}.
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.
group - (potential) source of information that needs to be added.attributes - attributes to add directory-specific information to.protected String getInitialGroupMemberDN()
If this method returns null or blank string, no member DN will be added.
public Group addGroup(GroupTemplate group) throws InvalidGroupException, OperationFailedException
addGroup in interface RemoteDirectoryInvalidGroupExceptionOperationFailedExceptionpublic Group updateGroup(GroupTemplate group) throws GroupNotFoundException, OperationFailedException
updateGroup in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic void removeGroup(String name) throws GroupNotFoundException, OperationFailedException
removeGroup in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic Group renameGroup(String oldName, String newName) throws GroupNotFoundException, InvalidGroupException, OperationFailedException
renameGroup in interface RemoteDirectoryGroupNotFoundExceptionInvalidGroupExceptionOperationFailedExceptionpublic void storeGroupAttributes(String groupName, Map<String,Set<String>> attributes) throws GroupNotFoundException, OperationFailedException
storeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException, OperationFailedException
removeGroupAttributes in interface RemoteDirectoryGroupNotFoundExceptionOperationFailedExceptionpublic <T> List<T> searchGroupRelationships(MembershipQuery<T> query) throws OperationFailedException
searchGroupRelationships in interface RemoteDirectoryOperationFailedExceptionprotected abstract <T> Iterable<T> searchGroupRelationshipsWithGroupTypeSpecified(MembershipQuery<T> query) throws OperationFailedException
query - membership query with all GroupType's not null.OperationFailedException - if the operation failed due to a communication error with the remote directory,
or if the query is invalidprotected abstract LDAPCredentialEncoder getCredentialEncoder()
public boolean supportsSettingEncryptedCredential()
supportsSettingEncryptedCredential in interface RemoteDirectorypublic boolean supportsPasswordExpiration()
supportsPasswordExpiration in interface RemoteDirectoryfalse, always.public void expireAllPasswords()
throws OperationFailedException
expireAllPasswords in interface RemoteDirectoryOperationFailedExceptionpublic boolean supportsNestedGroups()
supportsNestedGroups in interface RemoteDirectorypublic boolean isRolesDisabled()
isRolesDisabled in interface RemoteDirectorypublic void testConnection()
throws OperationFailedException
testConnection in interface RemoteDirectoryOperationFailedExceptionprotected <T extends LDAPDirectoryEntity> LdapName asLdapName(String dn, String entityName, Class<T> entityClass) throws UserNotFoundException, GroupNotFoundException
This mainly affects the escaping of slashes in DNs.
The resulting javax.naming.Name is not designed to be used for caching or comparisons, rather, it is to be used for direct calls into spring-ldap's ldapTemplate.
dn - string version of DN.entityName - used if NotFoundException needs to be thrown.entityClass - in case there is a problem converting the dn into an LdapName a NotFoundException of this type (group/user) will be thrown.
Must implement User or Group, otherwise an IllegalArgumentException will be thrown.UserNotFoundException - unable to construct LdapName for User.GroupNotFoundException - unable to construct LdapName for Group.protected LdapName asLdapGroupName(String dn, String groupName) throws GroupNotFoundException
dn - DN of the Group.groupName - for GNFE exception.GroupNotFoundException - unable to construct LdapName.protected LdapName asLdapUserName(String dn, String userName) throws UserNotFoundException
dn - DN of the User.userName - for GNFE exception.UserNotFoundException - unable to construct LdapName.public boolean supportsInactiveAccounts()
supportsInactiveAccounts in interface RemoteDirectorypublic RemoteDirectory getAuthoritativeDirectory()
getAuthoritativeDirectory in interface RemoteDirectoryprotected ContextMapperWithRequiredAttributes<AvatarReference.BlobAvatar> avatarMapper()
public AvatarReference.BlobAvatar getUserAvatarByName(String username, int sizeHint) throws OperationFailedException
getUserAvatarByName in interface RemoteDirectoryOperationFailedExceptionCopyright © 2023 Atlassian. All rights reserved.