|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.integration.model.DirectoryEntity com.atlassian.crowd.integration.directory.internal.InternalDirectory com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory
public class DelegatedAuthenticationDirectory
This implementation of a RemoteDirectory
provides delegated authentication to an underlying remote
LDAP implementation.
Field Summary | |
---|---|
static java.lang.String |
DELEGATED_DIRECTORY_TYPE
|
Fields inherited from class com.atlassian.crowd.integration.directory.internal.InternalDirectory |
---|
ATTRIBUTE_PASSWORD_HISTORY_COUNT, ATTRIBUTE_PASSWORD_MAX_ATTEMPTS, ATTRIBUTE_PASSWORD_MAX_CHANGE_TIME, ATTRIBUTE_PASSWORD_REGEX, ATTRIBUTE_USER_ENCRYPTION_METHOD, NAME |
Fields inherited from class com.atlassian.crowd.integration.model.DirectoryEntity |
---|
active, attributes, conception, description, directoryID, ID, lastModified, name |
Constructor Summary | |
---|---|
DelegatedAuthenticationDirectory()
|
Method Summary | |
---|---|
RemotePrincipal |
addPrincipal(RemotePrincipal principal)
Adds a principal to the directory store. |
void |
addPrincipalToGroup(java.lang.String principalName,
java.lang.String groupName)
Adds a principal to a group. |
void |
addPrincipalToRole(java.lang.String principalName,
java.lang.String roleName)
Adds a principal to a role. |
RemotePrincipal |
authenticate(java.lang.String name,
PasswordCredential[] credentials)
Authenticates a principal verses the directory store. |
protected void |
encryptCredentials(java.util.List credentials)
|
java.util.List<RemoteGroup> |
findGroupMemberships(java.lang.String principalName)
Returns a list of groups |
RemotePrincipal |
findPrincipalByName(java.lang.String principalName)
Finds the principal that matches the supplied name . |
java.util.List<RemoteRole> |
findRoleMemberships(java.lang.String principalName)
Returns a list of roles |
protected RemoteDirectory |
getDelegatedDirectory()
|
java.lang.String |
getDirectoryType()
Returns the name of the type of directory. |
boolean |
isGroupMember(java.lang.String group,
java.lang.String principalName)
Checks if a principal is a direct OR nested member of a group. |
boolean |
isRoleMember(java.lang.String roleName,
java.lang.String principalName)
Checks if a principal is a member of a role. |
void |
removePrincipal(java.lang.String principalName)
Removes the principal that matches the supplied name . |
void |
removePrincipalFromGroup(java.lang.String principalName,
java.lang.String groupName)
Removes a principal from a group. |
void |
removePrincipalFromRole(java.lang.String principalName,
java.lang.String roleName)
Removes a principal from a role. |
java.util.List<RemotePrincipal> |
searchPrincipals(SearchContext searchContext)
Search for all principals who match the supplied search criteria. |
void |
setDirectoryInstanceLoader(DirectoryInstanceLoader directoryInstanceLoader)
|
void |
setI18nHelper(I18nHelper i18nHelper)
|
void |
testConnection()
Test if a connection to the directory server can be established. |
RemotePrincipal |
updatePrincipal(RemotePrincipal principal)
Updates the principal by the name attribute. |
void |
updatePrincipalCredential(java.lang.String principalName,
PasswordCredential credential)
Updates the password credential for a principal. |
protected void |
validateRegex(PasswordCredential credential)
|
Methods inherited from class com.atlassian.crowd.integration.model.DirectoryEntity |
---|
compareTo, equals, getAttribute, getAttributeBooleanValue, getAttributes, getConception, getDescription, getID, getLastModified, getName, getSingleAttributeLongValue, getSingleAttributeValue, hashCode, isActive, setActive, setAttribute, setAttributes, setConception, setDescription, setID, setLastModified, setName, setOrReplaceAttribute, setOrReplaceAttribute, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.atlassian.crowd.integration.directory.RemoteDirectory |
---|
getAttributes, getID, setAttributes, setID |
Field Detail |
---|
public static final java.lang.String DELEGATED_DIRECTORY_TYPE
Constructor Detail |
---|
public DelegatedAuthenticationDirectory()
Method Detail |
---|
public RemotePrincipal addPrincipal(RemotePrincipal principal) throws InvalidPrincipalException, InvalidCredentialException
RemoteDirectory
addPrincipal
in interface RemoteDirectory
addPrincipal
in class InternalDirectory
principal
- The principal to add.
InvalidPrincipalException
- The supplied principal is invalid.
InvalidCredentialException
- The supplied credential(s) are invalid.public RemotePrincipal authenticate(java.lang.String name, PasswordCredential[] credentials) throws java.rmi.RemoteException, InvalidPrincipalException, InactiveAccountException, InvalidAuthenticationException
RemoteDirectory
authenticate
in interface RemoteDirectory
authenticate
in class InternalDirectory
name
- The name of the principal.credentials
- The supplied credentials.
java.rmi.RemoteException
- There was a problem with the directory.
InvalidPrincipalException
- The supplied principal is invalid.
InactiveAccountException
- The supplied principal is inactive.
InvalidAuthenticationException
- The supplied authentication is invalid.public boolean isGroupMember(java.lang.String group, java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
isGroupMember
in interface RemoteDirectory
isGroupMember
in class InternalDirectory
group
- The group name.principalName
- The principal name.
true
if and only if the principal is a member of the group, otherwise false
.
ObjectNotFoundException
- If the group or principal cannot be foundpublic java.util.List<RemotePrincipal> searchPrincipals(SearchContext searchContext) throws InvalidSearchTermException
RemoteDirectory
principals
who match the supplied search criteria.
searchPrincipals
in interface RemoteDirectory
searchPrincipals
in class InternalDirectory
searchContext
- The search criteria.
results
.
InvalidSearchTermException
- The search terms provided were invalidpublic RemotePrincipal findPrincipalByName(java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
principal
that matches the supplied name
.
findPrincipalByName
in interface RemoteDirectory
findPrincipalByName
in class InternalDirectory
principalName
- The name of the principal.
ObjectNotFoundException
- The principal does not exist.public RemotePrincipal updatePrincipal(RemotePrincipal principal) throws ObjectNotFoundException
RemoteDirectory
name
attribute.
updatePrincipal
in interface RemoteDirectory
updatePrincipal
in class InternalDirectory
principal
- The principal to update.
ObjectNotFoundException
- The principal does not exist.public void addPrincipalToGroup(java.lang.String principalName, java.lang.String groupName) throws ObjectNotFoundException
RemoteDirectory
addPrincipalToGroup
in interface RemoteDirectory
addPrincipalToGroup
in class InternalDirectory
principalName
- The name of the principal.groupName
- The name of the group.
ObjectNotFoundException
- if principal or group cannot be found.public void removePrincipalFromGroup(java.lang.String principalName, java.lang.String groupName) throws ObjectNotFoundException
RemoteDirectory
removePrincipalFromGroup
in interface RemoteDirectory
removePrincipalFromGroup
in class InternalDirectory
principalName
- The name of the principal.groupName
- The name of the group.
ObjectNotFoundException
- if principal or group cannot be found.public void addPrincipalToRole(java.lang.String principalName, java.lang.String roleName) throws ObjectNotFoundException
RemoteDirectory
addPrincipalToRole
in interface RemoteDirectory
addPrincipalToRole
in class InternalDirectory
principalName
- The name of the principal.roleName
- The name of the role.
ObjectNotFoundException
- if principal or role cannot be found.public void removePrincipalFromRole(java.lang.String principalName, java.lang.String roleName) throws ObjectNotFoundException
RemoteDirectory
removePrincipalFromRole
in interface RemoteDirectory
removePrincipalFromRole
in class InternalDirectory
principalName
- The name of the principal.roleName
- The name of the role.
ObjectNotFoundException
- if principal or role cannot be found.public void removePrincipal(java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
principal
that matches the supplied name
.
removePrincipal
in interface RemoteDirectory
removePrincipal
in class InternalDirectory
principalName
- The name of the principal.
ObjectNotFoundException
- The principal does not exist.public void updatePrincipalCredential(java.lang.String principalName, PasswordCredential credential) throws ObjectNotFoundException, InvalidCredentialException
RemoteDirectory
updatePrincipalCredential
in interface RemoteDirectory
updatePrincipalCredential
in class InternalDirectory
principalName
- The name of the principal.credential
- The new credential.
ObjectNotFoundException
- The principal does not exist.
InvalidCredentialException
- The supplied credential is invalid.public void testConnection() throws java.rmi.RemoteException
RemoteDirectory
testConnection
in interface RemoteDirectory
testConnection
in class InternalDirectory
java.rmi.RemoteException
- An unknown wire exception occurred.public boolean isRoleMember(java.lang.String roleName, java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
isRoleMember
in interface RemoteDirectory
isRoleMember
in class InternalDirectory
roleName
- The group name.principalName
- The principal name.
true
if and only if the principal is a member of the role, otherwise false
.
ObjectNotFoundException
- If the role or the principal don't existpublic java.util.List<RemoteGroup> findGroupMemberships(java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
findGroupMemberships
in interface RemoteDirectory
findGroupMemberships
in class InternalDirectory
principalName
- name of the principal.
ObjectNotFoundException
- if principal cannot be found.public java.util.List<RemoteRole> findRoleMemberships(java.lang.String principalName) throws ObjectNotFoundException
RemoteDirectory
findRoleMemberships
in interface RemoteDirectory
findRoleMemberships
in class InternalDirectory
principalName
- name of the principal.
ObjectNotFoundException
- if principal cannot be found.protected void encryptCredentials(java.util.List credentials)
encryptCredentials
in class InternalDirectory
protected void validateRegex(PasswordCredential credential) throws InvalidCredentialException
validateRegex
in class InternalDirectory
InvalidCredentialException
protected RemoteDirectory getDelegatedDirectory() throws DirectoryInstantiationException
DirectoryInstantiationException
public java.lang.String getDirectoryType()
RemoteDirectory
getDirectoryType
in interface RemoteDirectory
getDirectoryType
in class InternalDirectory
public void setDirectoryInstanceLoader(DirectoryInstanceLoader directoryInstanceLoader)
public void setI18nHelper(I18nHelper i18nHelper)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |