com.atlassian.crowd.integration.directory
Interface RemoteDirectory

All Known Implementing Classes:
GenericLDAP, InternalDirectory, MicrosoftActiveDirectory, OpenLDAP, SpringLDAPConnector, SunONE

public interface RemoteDirectory

This interface is to be implemented when integrating various directory stores.

Version:
1.0
Author:
Justen Stepka

Field Summary
static String DIRECTORY_TYPE
          The name of the directory store.
 
Method Summary
 RemoteGroup addGroup(RemoteGroup group)
          Adds a group to the directory store.
 RemotePrincipal addPrincipal(RemotePrincipal principal)
          Adds a principal to the directory store.
 void addPrincipalToGroup(String name, String unsubscribedGroup)
          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.
 RemoteGroup findGroupByName(String name)
          Finds the group that matches the supplied name.
 List findGroupMemberships(String principal)
          Returns a list of group names that a principal is a member of.
 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 that a principal is a member of.
 Map getAttributes()
          Gets the mapped values of the directory store.
 String getDirectoryType()
          Returns the DIRECTORY_TYPE name of the implementation.
 long getID()
          Gets the internal unique ID of the directory store.
 boolean isGroupMember(String group, String principal)
          Checks if a principal is a member of a group.
 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)
          When a directory store is loaded, the values will be set by the crowd framework.
 void setID(long ID)
          When a directory store is loaded, the ID will be set by the crowd framework.
 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.
 

Field Detail

DIRECTORY_TYPE

static final String DIRECTORY_TYPE
The name of the directory store.

See Also:
Constant Field Values
Method Detail

getID

long getID()
Gets the internal unique ID of the directory store.

Returns:
The ID.

setID

void setID(long ID)
When a directory store is loaded, the ID will be set by the crowd framework.

Parameters:
ID - The ID.

getDirectoryType

String getDirectoryType()
Returns the DIRECTORY_TYPE name of the implementation.

Returns:
The name of the implementation.

getAttributes

Map getAttributes()
Gets the mapped values of the directory store.

Returns:
The values.

setAttributes

void setAttributes(Map attributes)
When a directory store is loaded, the values will be set by the crowd framework.

Parameters:
attributes - The values.

addPrincipal

RemotePrincipal addPrincipal(RemotePrincipal principal)
                             throws InvalidPrincipalException,
                                    RemoteException,
                                    InvalidCredentialException
Adds a principal to the directory store.

Parameters:
principal - The principal to add.
Returns:
The principal with any updated attributes.
Throws:
InvalidPrincipalException - The supplied principal is invalid.
RemoteException - An unknown remote exception occured.
InvalidCredentialException - The supplied credential(s) are invalid.

addGroup

RemoteGroup addGroup(RemoteGroup group)
                     throws InvalidGroupException,
                            RemoteException
Adds a group to the directory store.

Parameters:
group - The group to add.
Returns:
The group with any updated attributes.
Throws:
InvalidGroupException - The supplied group is invalid.
RemoteException - An unknown remote exception occured.

authenticate

RemotePrincipal authenticate(String name,
                             PasswordCredential[] credentials)
                             throws RemoteException,
                                    InvalidPrincipalException,
                                    InactiveAccountException,
                                    InvalidAuthenticationException
Authenticates a principal verses the directory store.

Parameters:
name - The name of the principal.
credentials - The supplied credentials.
Returns:
The populated principal if the authentication is valid.
Throws:
RemoteException - An unknown remote exception occured.
InvalidPrincipalException - The supplied principal is invalid.
InactiveAccountException - The supplied principal is inactive.
InvalidAuthenticationException - The supplied authentication is invalid.

isGroupMember

boolean isGroupMember(String group,
                      String principal)
                      throws RemoteException
Checks if a principal is a member of a group.

Parameters:
group - The group name.
principal - The principal name.
Returns:
true if and only if the principal is a member of the group, otherwise false.
Throws:
RemoteException - An unknown remote exception occured.

searchGroups

List searchGroups(SearchContext searchContext)
                  throws RemoteException
Searches for all principals who match the supplied search criteria.

Parameters:
searchContext - The search criteria.
Returns:
The search results.
Throws:
RemoteException - An unknown remote exception occured.

findGroupByName

RemoteGroup findGroupByName(String name)
                            throws RemoteException,
                                   ObjectNotFoundException
Finds the group that matches the supplied name.

Parameters:
name - The name of the group.
Returns:
The populated group.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The group does not exist.

updateGroup

RemoteGroup updateGroup(RemoteGroup group)
                        throws RemoteException,
                               ObjectNotFoundException
Updates the group by the name attribute.

Parameters:
group - The group to update.
Returns:
The populated group.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - the group does not exist.

searchRoles

List searchRoles(SearchContext searchContext)
                 throws RemoteException
Search for all roles who match the supplied search criteria.

Parameters:
searchContext - The search criteria.
Returns:
The search results.
Throws:
RemoteException - an unknown remote exception occured.

findRoleByName

RemoteRole findRoleByName(String name)
                          throws RemoteException,
                                 ObjectNotFoundException
Finds the role that matches the supplied name.

Parameters:
name - The name of the role.
Returns:
The populated role.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.

addRole

RemoteRole addRole(RemoteRole role)
                   throws InvalidRoleException,
                          RemoteException
Adds a role to the directory store.

Parameters:
role - The role to add.
Returns:
The role with any updated attributes.
Throws:
InvalidRoleException - The supplied role is invalid.
RemoteException - An unknown remote exception occured.

updateRole

RemoteRole updateRole(RemoteRole role)
                      throws RemoteException,
                             ObjectNotFoundException
Updates the role by the name attribute.

Parameters:
role - The role to update.
Returns:
The populated role.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.

removeGroup

void removeGroup(String name)
                 throws RemoteException,
                        ObjectNotFoundException
Removes the role that matches the supplied name.

Parameters:
name - The name of the role.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.

removeRole

void removeRole(String name)
                throws RemoteException,
                       ObjectNotFoundException
Removes the group that matches the supplied name.

Parameters:
name - The name of the group.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.

searchPrincipals

List searchPrincipals(SearchContext searchContext)
                      throws RemoteException
Search for all principals who match the supplied search criteria.

Parameters:
searchContext - The search criteria.
Returns:
The search results.
Throws:
RemoteException - an unknown remote exception occured.

findPrincipalByName

RemotePrincipal findPrincipalByName(String name)
                                    throws RemoteException,
                                           ObjectNotFoundException
Finds the principal that matches the supplied name.

Parameters:
name - The name of the principal.
Returns:
The populated principal.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.

updatePrincipal

RemotePrincipal updatePrincipal(RemotePrincipal principal)
                                throws RemoteException,
                                       ObjectNotFoundException
Updates the principal by the name attribute.

Parameters:
principal - The principal to update.
Returns:
The populated principal.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The role does not exist.

addPrincipalToGroup

void addPrincipalToGroup(String name,
                         String unsubscribedGroup)
                         throws RemoteException
Adds a principal to a group.

Parameters:
name - The name of the principal.
unsubscribedGroup - The name of the group.
Throws:
RemoteException - An unknown wire exception occured.

removePrincipalFromGroup

void removePrincipalFromGroup(String name,
                              String unsubscribedGroup)
                              throws RemoteException
Removes a principal from a group.

Parameters:
name - The name of the principal.
unsubscribedGroup - The name of the group.
Throws:
RemoteException - An unknown wire exception occured.

addPrincipalToRole

void addPrincipalToRole(String name,
                        String unsubscribedRole)
                        throws RemoteException
Adds a principal to a role.

Parameters:
name - The name of the principal.
unsubscribedRole - The name of the role.
Throws:
RemoteException - An unknown wire exception occured.

removePrincipalFromRole

void removePrincipalFromRole(String name,
                             String removeRole)
                             throws RemoteException
Removes a principal from a role.

Parameters:
name - The name of the principal.
removeRole - The name of the role.
Throws:
RemoteException - An unknown wire exception occured.

removePrincipal

void removePrincipal(String name)
                     throws RemoteException,
                            ObjectNotFoundException
Removes the principal that matches the supplied name.

Parameters:
name - The name of the principal.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.

updatePrincipalCredential

void updatePrincipalCredential(String name,
                               PasswordCredential credential)
                               throws RemoteException,
                                      ObjectNotFoundException,
                                      InvalidCredentialException
Updates the password credential for a principal.

Parameters:
name - The name of the principal.
credential - The new credential.
Throws:
RemoteException - An unknown remote exception occured.
ObjectNotFoundException - The principal does not exist.
InvalidCredentialException - The supplied credential is invalid.

testConnection

void testConnection()
                    throws RemoteException
Test if a connection to the directory server can be established.

Throws:
RemoteException - An unknown wire exception occured.

isRoleMember

boolean isRoleMember(String role,
                     String principal)
                     throws RemoteException
Checks if a principal is a member of a role.

Parameters:
role - The group name.
principal - The principal name.
Returns:
true if and only if the principal is a member of the role, otherwise false.
Throws:
RemoteException - An unknown remote exception occured.

findGroupMemberships

List findGroupMemberships(String principal)
                          throws RemoteException,
                                 ObjectNotFoundException
Returns a list of group names that a principal is a member of.

Returns:
List of group names.
Throws:
RemoteException - An unknown and remote exception occured.
ObjectNotFoundException

findRoleMemberships

List findRoleMemberships(String principalName)
                         throws RemoteException,
                                ObjectNotFoundException
Returns a list of role names that a principal is a member of.

Returns:
List of group names.
Throws:
RemoteException - An unknown and remote exception occured.
ObjectNotFoundException


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.