|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.integration.directory.connector.SpringLDAPConnector
public abstract class SpringLDAPConnector
| Field Summary | |
|---|---|
protected Map |
attributes
Attributes for the entity. |
protected static int |
DEFAULT_PAGE_SIZE
|
protected LDAPPropertiesMapper |
ldapPropertiesMapper
|
protected LdapTemplate |
ldapTemplate
|
static String |
NAME
The name of the server: Microsoft Active Directory. |
protected static String |
PRINCIPAL_NO_VALID_PASSWORD
Exception message when unable to process a supplied password credential. |
| Fields inherited from interface com.atlassian.crowd.integration.directory.RemoteDirectory |
|---|
DIRECTORY_TYPE |
| Constructor Summary | |
|---|---|
SpringLDAPConnector()
|
|
| Method Summary | |
|---|---|
protected void |
addContainerObject(DirectoryContainer containerObject,
String baseDN,
String objectType,
String nameAttribute,
String memberAttribute,
String descriptionAttribute)
|
RemoteGroup |
addGroup(RemoteGroup group)
Adds a group to the directory store. |
protected Attributes |
addPrincipalGeneric(RemotePrincipal principal)
Translates a principal into LDAP attributes. |
void |
addPrincipalToGroup(String principal,
String group)
Adds a principal to a group. |
void |
addPrincipalToRole(String name,
String unsubscribedRole)
Adds a principal to a role. |
RemoteRole |
addRole(RemoteRole role)
Adds a role to the directory store. |
RemotePrincipal |
authenticate(String name,
PasswordCredential[] credentials)
Authenticates a principal verses the directory store. |
protected String |
buildDN(String name,
String baseDN,
String objectFilter,
String nameAttribute)
|
RemoteGroup |
findGroupByName(String name)
Finds the group that matches the supplied name. |
List |
findGroupMemberships(String principal)
Returns a list of group names |
RemotePrincipal |
findPrincipalByName(String name)
Finds the principal that matches the supplied name. |
RemoteRole |
findRoleByName(String name)
Finds the role that matches the supplied name. |
List |
findRoleMemberships(String principalName)
Returns a list of role names |
Map |
getAttributes()
Gets the attributes of the entity. |
String |
getDirectoryType()
Returns the DIRECTORY_TYPE name of the implementation. |
protected String |
getGroupDN(String name)
|
long |
getID()
Gets the internal unique ID of the directory store. |
LDAPPropertiesMapper |
getLdapPropertiesMapper()
|
protected String |
getPrincipalDN(String name)
|
protected String |
getRoleDN(String name)
|
boolean |
isGroupMember(String group,
String principal)
Checks if a principal is a member of a group. |
protected boolean |
isMemeber(String objectFilter,
String containerObjectDN,
String memberAttribute,
String principalDN)
|
boolean |
isRoleMember(String role,
String principal)
Checks if a principal is a member of a role. |
void |
removeGroup(String name)
Removes the role that matches the supplied name. |
void |
removePrincipal(String name)
Removes the principal that matches the supplied name. |
void |
removePrincipalFromGroup(String name,
String unsubscribedGroup)
Removes a principal from a group. |
void |
removePrincipalFromRole(String name,
String removeRole)
Removes a principal from a role. |
void |
removeRole(String name)
Removes the group that matches the supplied name. |
List |
searchGroups(SearchContext searchContext)
Searches for all principals who match the supplied search criteria. |
List |
searchPrincipals(SearchContext searchContext)
Search for all principals who match the supplied search criteria. |
List |
searchRoles(SearchContext searchContext)
Search for all roles who match the supplied search criteria. |
void |
setAttributes(Map attributes)
Sets the attributes of the entity. |
void |
setID(long ID)
When a directory store is loaded, the ID will be set by the
crowd framework. |
void |
setLdapPropertiesMapper(LDAPPropertiesMapper ldapPropertiesMapper)
|
void |
testConnection()
Test if a connection to the directory server can be established. |
RemoteGroup |
updateGroup(RemoteGroup group)
Updates the group by the name attribute. |
RemotePrincipal |
updatePrincipal(RemotePrincipal principal)
Updates the principal by the name attribute. |
void |
updatePrincipalCredential(String name,
PasswordCredential credential)
Updates the password credential for a principal. |
RemoteRole |
updateRole(RemoteRole role)
Updates the role by the name attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.atlassian.crowd.integration.directory.RemoteDirectory |
|---|
addPrincipal |
| Field Detail |
|---|
protected Map attributes
Attributes for the entity.
public static final String NAME
protected static final String PRINCIPAL_NO_VALID_PASSWORD
protected static int DEFAULT_PAGE_SIZE
protected LdapTemplate ldapTemplate
protected LDAPPropertiesMapper ldapPropertiesMapper
| Constructor Detail |
|---|
public SpringLDAPConnector()
| Method Detail |
|---|
public long getID()
RemoteDirectoryID of the directory store.
getID in interface RemoteDirectoryID.public void setID(long ID)
RemoteDirectoryID will be set by the
crowd framework.
setID in interface RemoteDirectoryID - The ID.public String getDirectoryType()
RemoteDirectoryDIRECTORY_TYPE name of the implementation.
getDirectoryType in interface RemoteDirectorypublic LDAPPropertiesMapper getLdapPropertiesMapper()
public void setLdapPropertiesMapper(LDAPPropertiesMapper ldapPropertiesMapper)
public Map getAttributes()
getAttributes in interface RemoteDirectorypublic void setAttributes(Map attributes)
setAttributes in interface RemoteDirectoryattributes - The attributes.
protected String buildDN(String name,
String baseDN,
String objectFilter,
String nameAttribute)
throws ObjectNotFoundException
ObjectNotFoundException
protected String getPrincipalDN(String name)
throws ObjectNotFoundException
ObjectNotFoundException
protected String getGroupDN(String name)
throws ObjectNotFoundException
ObjectNotFoundException
protected String getRoleDN(String name)
throws ObjectNotFoundException
ObjectNotFoundExceptionprotected Attributes addPrincipalGeneric(RemotePrincipal principal)
principal into LDAP attributes.
principal - The principal.
protected void addContainerObject(DirectoryContainer containerObject,
String baseDN,
String objectType,
String nameAttribute,
String memberAttribute,
String descriptionAttribute)
throws RemoteException
RemoteException
public RemoteGroup addGroup(RemoteGroup group)
throws InvalidGroupException,
RemoteException
RemoteDirectory
addGroup in interface RemoteDirectorygroup - The group to add.
InvalidGroupException - The supplied group is invalid.
RemoteException - An unknown remote exception occured.
public RemotePrincipal authenticate(String name,
PasswordCredential[] credentials)
throws RemoteException,
InvalidPrincipalException,
InactiveAccountException,
InvalidAuthenticationException
RemoteDirectory
authenticate in interface RemoteDirectoryname - The name of the principal.credentials - The supplied credentials.
RemoteException - An unknown remote exception occured.
InvalidPrincipalException - The supplied principal is invalid.
InactiveAccountException - The supplied principal is inactive.
InvalidAuthenticationException - The supplied authentication is invalid.
protected boolean isMemeber(String objectFilter,
String containerObjectDN,
String memberAttribute,
String principalDN)
throws NamingException
NamingException
public boolean isGroupMember(String group,
String principal)
throws RemoteException
RemoteDirectory
isGroupMember in interface RemoteDirectorygroup - The group name.principal - The principal name.
true if and only if the principal is a member of the group, otherwise false.
RemoteException - An unknown remote exception occured.
public List searchGroups(SearchContext searchContext)
throws RemoteException
RemoteDirectoryprincipals who match the supplied search criteria.
searchGroups in interface RemoteDirectorysearchContext - The search criteria.
results.
RemoteException - An unknown remote exception occured.
public RemoteGroup findGroupByName(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectorygroup that matches the supplied name.
findGroupByName in interface RemoteDirectoryname - The name of the group.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The group does not exist.
public RemoteGroup updateGroup(RemoteGroup group)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryname attribute.
updateGroup in interface RemoteDirectorygroup - The group to update.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - the group does not exist.
public List searchRoles(SearchContext searchContext)
throws RemoteException
RemoteDirectoryroles who match the supplied search criteria.
searchRoles in interface RemoteDirectorysearchContext - The search criteria.
results.
RemoteException - an unknown remote exception occured.
public RemoteRole findRoleByName(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryrole that matches the supplied name.
findRoleByName in interface RemoteDirectoryname - The name of the role.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.
public RemoteRole addRole(RemoteRole role)
throws InvalidRoleException,
RemoteException
RemoteDirectory
addRole in interface RemoteDirectoryrole - The role to add.
InvalidRoleException - The supplied role is invalid.
RemoteException - An unknown remote exception occured.
public RemoteRole updateRole(RemoteRole role)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryname attribute.
updateRole in interface RemoteDirectoryrole - The role to update.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.
public void removeGroup(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryrole that matches the supplied name.
removeGroup in interface RemoteDirectoryname - The name of the role.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.
public void removeRole(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectorygroup that matches the supplied name.
removeRole in interface RemoteDirectoryname - The name of the group.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.
public List searchPrincipals(SearchContext searchContext)
throws RemoteException
RemoteDirectoryprincipals who match the supplied search criteria.
searchPrincipals in interface RemoteDirectorysearchContext - The search criteria.
results.
RemoteException - an unknown remote exception occured.
public RemotePrincipal findPrincipalByName(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryprincipal that matches the supplied name.
findPrincipalByName in interface RemoteDirectoryname - The name of the principal.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.
public RemotePrincipal updatePrincipal(RemotePrincipal principal)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryname attribute.
updatePrincipal in interface RemoteDirectoryprincipal - The principal to update.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.
public void addPrincipalToGroup(String principal,
String group)
throws RemoteException
RemoteDirectory
addPrincipalToGroup in interface RemoteDirectoryprincipal - The name of the principal.group - The name of the group.
RemoteException - An unknown wire exception occured.
public void removePrincipalFromGroup(String name,
String unsubscribedGroup)
throws RemoteException
RemoteDirectory
removePrincipalFromGroup in interface RemoteDirectoryname - The name of the principal.unsubscribedGroup - The name of the group.
RemoteException - An unknown wire exception occured.
public void addPrincipalToRole(String name,
String unsubscribedRole)
throws RemoteException
RemoteDirectory
addPrincipalToRole in interface RemoteDirectoryname - The name of the principal.unsubscribedRole - The name of the role.
RemoteException - An unknown wire exception occured.
public void removePrincipalFromRole(String name,
String removeRole)
throws RemoteException
RemoteDirectory
removePrincipalFromRole in interface RemoteDirectoryname - The name of the principal.removeRole - The name of the role.
RemoteException - An unknown wire exception occured.
public void removePrincipal(String name)
throws RemoteException,
ObjectNotFoundException
RemoteDirectoryprincipal that matches the supplied name.
removePrincipal in interface RemoteDirectoryname - The name of the principal.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.
public void updatePrincipalCredential(String name,
PasswordCredential credential)
throws RemoteException,
ObjectNotFoundException,
InvalidCredentialException
RemoteDirectory
updatePrincipalCredential in interface RemoteDirectoryname - The name of the principal.credential - The new credential.
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.
InvalidCredentialException - The supplied credential is invalid.
public void testConnection()
throws RemoteException
RemoteDirectory
testConnection in interface RemoteDirectoryRemoteException - An unknown wire exception occured.
public boolean isRoleMember(String role,
String principal)
throws RemoteException
RemoteDirectory
isRoleMember in interface RemoteDirectoryrole - The group name.principal - The principal name.
true if and only if the principal is a member of the role, otherwise false.
RemoteException - An unknown remote exception occured.
public List findGroupMemberships(String principal)
throws RemoteException,
ObjectNotFoundException
RemoteDirectory
findGroupMemberships in interface RemoteDirectoryRemoteException - An unknown and remote exception occured.
ObjectNotFoundException
public List findRoleMemberships(String principalName)
throws RemoteException,
ObjectNotFoundException
RemoteDirectory
findRoleMemberships in interface RemoteDirectoryRemoteException - An unknown and remote exception occured.
ObjectNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||