|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.manager.GenericManager com.atlassian.crowd.manager.application.ApplicationServiceGeneric
public class ApplicationServiceGeneric
Field Summary |
---|
Fields inherited from class com.atlassian.crowd.manager.GenericManager |
---|
cacheManager, i18nHelper, logger, propertyManager, tokenDAO |
Constructor Summary | |
---|---|
ApplicationServiceGeneric()
|
Method Summary | |
---|---|
RemoteGroup |
addGroup(Application application,
RemoteGroup group)
Adds a group to ALL possible directories assigned to the application. |
RemotePrincipal |
addPrincipal(Application application,
RemotePrincipal principal)
Adds the principal to ALL the permissible directories. |
void |
addPrincipalAttribute(Application application,
java.lang.String name,
java.lang.String attribute,
AttributeValues values)
Adds/sets the principal's attribute values. |
void |
addPrincipalToGroup(Application application,
java.lang.String principal,
java.lang.String group)
Makes principals matching the given name members of the group across ALL directories. |
void |
addPrincipalToRole(Application application,
java.lang.String principal,
java.lang.String role)
Makes principals matching the given name members of the role across ALL directories. |
RemoteRole |
addRole(Application application,
RemoteRole role)
Adds a role to ALL possible directories assigned to the application. |
Token |
authenticate(ApplicationAuthenticationContext authenticationContext)
|
Token |
authenticate(PrincipalAuthenticationContext authenticateContext)
|
Token |
authenticate(PrincipalAuthenticationContext authenticateContext,
boolean validatePassword)
Authenticates a principal and creates a token for the authentication. |
Token |
authenticate(PrincipalAuthenticationContext authenticateContext,
boolean validatePassword,
boolean ignoreCache)
|
Token |
authenticateIgnoreCache(PrincipalAuthenticationContext authenticateContext)
Authenticates a principal, bypassing any credential caching. |
RemoteGroup |
findGroupByName(Application application,
java.lang.String name)
This will form a RemoteGroup based on it's group name. |
java.util.List<java.lang.String> |
findGroupMemberships(Application application,
java.lang.String principalName)
For each principal matching the given name across assigned directories, build a list of group names in which the principals are members. |
protected java.util.List |
findGroupsByName(Application application,
java.lang.String name)
Finds a List |
RemotePrincipal |
findPrincipalByName(Application application,
java.lang.String name)
Returns the first principal with the matching username from all the directories assigned to the application. |
protected java.util.List<RemotePrincipal> |
findPrincipalsByName(Application application,
java.lang.String name)
Returns a list of the principals with the matching name in the associated directories for the application (in order). |
RemoteRole |
findRoleByName(Application application,
java.lang.String name)
This will form a RemoteRole based on it's role name. |
java.util.List |
findRoleMemberships(Application application,
java.lang.String principalName)
For each principal matching the given name across assigned directories, build a list of role names in which the principals are members. |
protected java.util.List |
findRolesByName(Application application,
java.lang.String name)
Finds a List |
protected java.lang.String |
getDirectoryName(long directoryID)
|
boolean |
isGroupMember(Application application,
java.lang.String group,
java.lang.String principal)
Determines group membership across directories assigned to an application. |
boolean |
isRoleMember(Application application,
java.lang.String role,
java.lang.String principal)
Determines role membership across directories assigned to an application. |
void |
removeGroup(Application application,
java.lang.String name)
Removes ALL groups matching the supplied name from each of the application's assigned directories. |
void |
removePrincipal(Application application,
java.lang.String name)
Removes ALL principals from each of the application's assigned directories. |
void |
removePrincipalAttribute(Application application,
java.lang.String name,
java.lang.String attribute)
Removes the attribute from principal. |
void |
removePrincipalFromGroup(Application application,
java.lang.String principal,
java.lang.String group)
Makes principals matching the given name not members of the group across ALL directories. |
void |
removePrincipalFromRole(Application application,
java.lang.String principal,
java.lang.String role)
Makes principals matching the given name not members of the role across ALL directories. |
void |
removeRole(Application application,
java.lang.String name)
Removes ALL roles matching the supplied name from each of the application's assigned directories. |
void |
resetPrincipalCredential(Application application,
java.lang.String name)
Resets the credentials of the first matching principal in the application's directories. |
java.util.Collection |
searchGroups(Application application,
SearchContext searchContext)
Returns a List |
java.util.Collection |
searchPrincipals(Application application,
SearchContext searchContext)
Returns a Collection |
java.util.Collection |
searchRoles(Application application,
SearchContext searchContext)
Returns a List |
void |
setApplicationDAO(ApplicationDAO applicationDAO)
|
void |
setDirectoryDAO(DirectoryDAO directoryDAO)
|
void |
setDirectoryManager(DirectoryManager directoryManager)
|
void |
setEventManager(com.atlassian.event.EventManager eventManager)
|
void |
setPasswordEncoderFactory(PasswordEncoderFactory passwordEncoderFactory)
|
void |
setPermissionManager(PermissionManager permissionManager)
|
void |
updateGroup(Application application,
java.lang.String name,
java.lang.String description,
boolean active)
Updates the ALL groups located from the list of directories assigned to an application Currently available fields that can be updated are description and active |
void |
updatePrincipalAttribute(Application application,
java.lang.String name,
java.lang.String attribute,
AttributeValues values)
Adds or replaces the existing principal's attribute values. |
void |
updatePrincipalCredential(Application application,
java.lang.String name,
PasswordCredential credential)
Updates the credentials of the first matching principal in the application's directories. |
void |
updateRole(Application application,
java.lang.String name,
java.lang.String description,
boolean active)
Updates the ALL roles located from the list of directories assigned to an application Currently available fields that can be updated are description and active |
Token |
validateToken(java.lang.String tokenKey,
ValidationFactor[] clientValidationFactors)
|
Token |
validateToken(java.lang.String principalTokenKey,
ValidationFactor[] validationFactors,
java.lang.String applicationName)
|
Methods inherited from class com.atlassian.crowd.manager.GenericManager |
---|
generateToken, genericValidateToken, hasAccess, hasAccess, setCacheManager, setI18nHelper, setPropertyManager, setTokenDAO, setTokenFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationServiceGeneric()
Method Detail |
---|
public RemoteGroup addGroup(Application application, RemoteGroup group) throws ApplicationServiceException, java.rmi.RemoteException, ApplicationPermissionException
addGroup
in interface ApplicationService
application
- add to application's assigned directories.group
- the group to add.
java.rmi.RemoteException
- error thrown by directory implementation.
ApplicationServiceException
- internal error, operation unsuccessful.
ApplicationPermissionException
- none of the application's associated directories have the
correct permission to perform the operation AND the group does not already exist in ANY assigned directory.public RemotePrincipal addPrincipal(Application application, RemotePrincipal principal) throws InvalidPrincipalException, ApplicationPermissionException, InvalidCredentialException, java.rmi.RemoteException
addPrincipal
in interface ApplicationService
application
- add to application's assigned directories.principal
- the principal to add.
InvalidPrincipalException
- principal already exists in ANY assigned directory.
java.rmi.RemoteException
- error thrown by directory implementation.
InvalidCredentialException
- principal credential validation error.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void addPrincipalAttribute(Application application, java.lang.String name, java.lang.String attribute, AttributeValues values) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
addPrincipalAttribute
in interface ApplicationService
application
- update in application's assigned directories.name
- name of principal.attribute
- attribute name.values
- attribute values.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if principal with given name does not exist in ANY assigned directory, or the underlying directory does not exist.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void addPrincipalToGroup(Application application, java.lang.String principal, java.lang.String group) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
addPrincipalToGroup
in interface ApplicationService
application
- modify groups in application's assigned directories.principal
- principal name.group
- group name.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- when the principal cannot be found in ANY
directory OR when ALL principals are in directories which don't have the requested group.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void addPrincipalToRole(Application application, java.lang.String principal, java.lang.String role) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
addPrincipalToRole
in interface ApplicationService
application
- modify roles in application's assigned directories.principal
- principal name.role
- role name.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- when the principal cannot be found in ANY
directory OR when ALL principals are in directories which don't have the requested role.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public RemoteRole addRole(Application application, RemoteRole role) throws java.rmi.RemoteException, ApplicationPermissionException
addRole
in interface ApplicationService
application
- add to application's assigned directories.role
- the role to add.
java.rmi.RemoteException
- error thrown by directory implementation.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public Token authenticate(ApplicationAuthenticationContext authenticationContext) throws ApplicationServiceException, InvalidAuthenticationException
authenticate
in interface ApplicationService
ApplicationServiceException
InvalidAuthenticationException
public Token authenticate(PrincipalAuthenticationContext authenticateContext) throws ApplicationServiceException, InvalidAuthenticationException, java.rmi.RemoteException, InactiveAccountException, ApplicationAccessDeniedException
authenticate
in interface ApplicationService
ApplicationServiceException
InvalidAuthenticationException
java.rmi.RemoteException
InactiveAccountException
ApplicationAccessDeniedException
ApplicationService.authenticate(com.atlassian.crowd.integration.authentication.PrincipalAuthenticationContext,boolean)
public Token authenticate(PrincipalAuthenticationContext authenticateContext, boolean validatePassword) throws ApplicationServiceException, InvalidAuthenticationException, java.rmi.RemoteException, InactiveAccountException, ApplicationAccessDeniedException
ApplicationService
authenticate
in interface ApplicationService
authenticateContext
- The authentication details for the principal.validatePassword
- If the password should be validated before generating a token.
ApplicationServiceException
- internal error, operation unsuccessful.
InvalidAuthenticationException
- The authentication was not successful.
java.rmi.RemoteException
- Error thrown by directory implementation.
InactiveAccountException
- The account attempting to authenticate is inactive.
ApplicationAccessDeniedException
- user does not have access to authenticate with application.public Token authenticateIgnoreCache(PrincipalAuthenticationContext authenticateContext) throws ApplicationServiceException, InvalidAuthenticationException, java.rmi.RemoteException, InactiveAccountException, ApplicationAccessDeniedException
ApplicationService
authenticateIgnoreCache
in interface ApplicationService
ApplicationServiceException
InvalidAuthenticationException
java.rmi.RemoteException
InactiveAccountException
ApplicationAccessDeniedException
ApplicationService.authenticate(com.atlassian.crowd.integration.authentication.PrincipalAuthenticationContext,boolean)
public Token authenticate(PrincipalAuthenticationContext authenticateContext, boolean validatePassword, boolean ignoreCache) throws ApplicationServiceException, InvalidAuthenticationException, java.rmi.RemoteException, InactiveAccountException, ApplicationAccessDeniedException
ApplicationServiceException
InvalidAuthenticationException
java.rmi.RemoteException
InactiveAccountException
ApplicationAccessDeniedException
public RemoteGroup findGroupByName(Application application, java.lang.String name) throws ObjectNotFoundException, java.rmi.RemoteException
findGroupByName
in interface ApplicationService
application
- application with associated directories to search.name
- name of the group to find.
ObjectNotFoundException
- group does not exist in ANY of the application's assigned directories.
java.rmi.RemoteException
- error thrown by directory implementation.public java.util.List<java.lang.String> findGroupMemberships(Application application, java.lang.String principalName) throws java.rmi.RemoteException, ObjectNotFoundException
findGroupMemberships
in interface ApplicationService
application
- application's directories to search.principalName
- name of the principal to find memberships for.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if no principals are found for the given application/directories, or the underlying directories cannot be foundpublic RemotePrincipal findPrincipalByName(Application application, java.lang.String name) throws ObjectNotFoundException
findPrincipalByName
in interface ApplicationService
application
- search application's assigned directories.name
- the username of the principal to find.
ObjectNotFoundException
- principal not found in any of the directories.public RemoteRole findRoleByName(Application application, java.lang.String name) throws ObjectNotFoundException, java.rmi.RemoteException
findRoleByName
in interface ApplicationService
application
- application with associated directories to search.name
- name of the role to find.
ObjectNotFoundException
- role does not exist in ANY of the application's assigned directories.
java.rmi.RemoteException
- error thrown by directory implementation.public java.util.List findRoleMemberships(Application application, java.lang.String principalName) throws java.rmi.RemoteException, ObjectNotFoundException
findRoleMemberships
in interface ApplicationService
application
- application's directories to search.principalName
- name of the principal to find memberships for.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if no principals are found for the given application/directories, or the underlying directories cannot be foundpublic boolean isGroupMember(Application application, java.lang.String group, java.lang.String principal) throws java.rmi.RemoteException
isGroupMember
in interface ApplicationService
application
- search application's assigned directories.group
- group name to check for membership.principal
- principal name to check for membership.
java.rmi.RemoteException
- error thrown by directory implementation.public boolean isRoleMember(Application application, java.lang.String role, java.lang.String principal) throws java.rmi.RemoteException
isRoleMember
in interface ApplicationService
application
- search application's assigned directories.role
- role name to check for membership.principal
- principal name to check for membership.
java.rmi.RemoteException
- error thrown by directory implementation.public void removeGroup(Application application, java.lang.String name) throws ObjectNotFoundException, java.rmi.RemoteException, ApplicationPermissionException
removeGroup
in interface ApplicationService
application
- remove from application's assigned directories.name
- the name of the principal to remove.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if group with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void removePrincipal(Application application, java.lang.String name) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
removePrincipal
in interface ApplicationService
application
- remove from application's assigned directories.name
- the name of the principal to remove.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if principal with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void removePrincipalAttribute(Application application, java.lang.String name, java.lang.String attribute) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
removePrincipalAttribute
in interface ApplicationService
application
- update in application's assigned directories.name
- name of principal.attribute
- attribute name.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if principal with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void removePrincipalFromGroup(Application application, java.lang.String principal, java.lang.String group) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
removePrincipalFromGroup
in interface ApplicationService
application
- modify groups in application's assigned directories.principal
- principal name.group
- group name.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- when the principal cannot be found in ANY
directory OR when ALL principals are in directories which don't have the requested group.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void removePrincipalFromRole(Application application, java.lang.String principal, java.lang.String role) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
removePrincipalFromRole
in interface ApplicationService
application
- modify roles in application's assigned directories.principal
- principal name.role
- role name.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- when the principal cannot be found in ANY
directory OR when ALL principals are in directories which don't have the requested role.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void removeRole(Application application, java.lang.String name) throws ObjectNotFoundException, java.rmi.RemoteException, ApplicationPermissionException
removeRole
in interface ApplicationService
application
- remove from application's assigned directories.name
- the name of the principal to remove.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if role with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void resetPrincipalCredential(Application application, java.lang.String name) throws java.rmi.RemoteException, ObjectNotFoundException, InvalidCredentialException, ApplicationPermissionException, InvalidEmailAddressException
resetPrincipalCredential
in interface ApplicationService
application
- update in application's assigned directories.name
- name of principal.
java.rmi.RemoteException
- error thrown by directory implementation.
InvalidCredentialException
- principal credential validation error.
ApplicationPermissionException
- the first directory in which the principal is found doesn't have the permission to modify principals.
ObjectNotFoundException
- if no principal with the given name exists in ANY assigned directory, or the associated directory does not exist
InvalidEmailAddressException
- the user doesn't have a valid email address and can't be notifiedpublic java.util.Collection searchGroups(Application application, SearchContext searchContext) throws java.rmi.RemoteException
searchGroups
in interface ApplicationService
application
- search application's assigned directories.searchContext
- search criteria.
java.rmi.RemoteException
- error thrown by directory implementation.public java.util.Collection searchPrincipals(Application application, SearchContext searchContext) throws java.rmi.RemoteException
searchPrincipals
in interface ApplicationService
application
- search application's assigned directories.searchContext
- search criteria.
java.rmi.RemoteException
- error thrown by directory implementation.public java.util.Collection searchRoles(Application application, SearchContext searchContext) throws java.rmi.RemoteException
searchRoles
in interface ApplicationService
application
- search application's assigned directories.searchContext
- search criteria.
java.rmi.RemoteException
- error thrown by directory implementation.public void updateGroup(Application application, java.lang.String name, java.lang.String description, boolean active) throws java.rmi.RemoteException, ApplicationPermissionException, ObjectNotFoundException
description
and active
updateGroup
in interface ApplicationService
application
- update in application's assigned directories.name
- the name of the group to update.description
- the new description of the group.active
- the new boolean active flag of the group.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if group with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void updatePrincipalAttribute(Application application, java.lang.String name, java.lang.String attribute, AttributeValues values) throws java.rmi.RemoteException, ObjectNotFoundException, ApplicationPermissionException
updatePrincipalAttribute
in interface ApplicationService
application
- update in application's assigned directories.name
- name of principal.attribute
- attribute name.values
- Listjava.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if principal with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public void updatePrincipalCredential(Application application, java.lang.String name, PasswordCredential credential) throws java.rmi.RemoteException, ObjectNotFoundException, InvalidCredentialException, ApplicationPermissionException
updatePrincipalCredential
in interface ApplicationService
application
- update in application's assigned directories.name
- name of principal.credential
- new credentials.
java.rmi.RemoteException
- error thrown by directory implementation.
InvalidCredentialException
- principal credential validation error.
ApplicationPermissionException
- the first directory in which the principal is found doesn't have the permission to modify principals.
ObjectNotFoundException
- if no principal with the given name exists in ANY assigned directory.public void updateRole(Application application, java.lang.String name, java.lang.String description, boolean active) throws java.rmi.RemoteException, ApplicationPermissionException, ObjectNotFoundException
description
and active
updateRole
in interface ApplicationService
application
- update in application's assigned directories.name
- the name of the role to update.description
- the new description of the role.active
- the new boolean active flag of the grop.
java.rmi.RemoteException
- error thrown by directory implementation.
ObjectNotFoundException
- if role with given name does not exist in ANY assigned directory.
ApplicationPermissionException
- none of the application's associated directories have the correct permission to perform the operation.public Token validateToken(java.lang.String tokenKey, ValidationFactor[] clientValidationFactors) throws InvalidTokenException, ApplicationServiceException
validateToken
in interface ApplicationService
InvalidTokenException
ApplicationServiceException
public Token validateToken(java.lang.String principalTokenKey, ValidationFactor[] validationFactors, java.lang.String applicationName) throws InvalidTokenException, java.rmi.RemoteException, ApplicationServiceException, ApplicationAccessDeniedException
validateToken
in interface ApplicationService
InvalidTokenException
java.rmi.RemoteException
ApplicationServiceException
ApplicationAccessDeniedException
protected java.util.List findGroupsByName(Application application, java.lang.String name) throws java.rmi.RemoteException, ObjectNotFoundException
application
- search application's assigned directoriesname
- name of group to search for.
java.rmi.RemoteException
- if there was an error in getting an instance
of any of the directories configured for the application.
ObjectNotFoundException
- if no groups found with the matching name.protected java.util.List<RemotePrincipal> findPrincipalsByName(Application application, java.lang.String name) throws ObjectNotFoundException, java.rmi.RemoteException
application
- the application with assigned directories to search.name
- name of principal to search.
ObjectNotFoundException
- if no matching principal found in ANY of the application's directories.
java.rmi.RemoteException
- error thrown by directory implementation.protected java.util.List findRolesByName(Application application, java.lang.String name) throws java.rmi.RemoteException, ObjectNotFoundException
application
- search application's assigned directoriesname
- name of role to search for.
java.rmi.RemoteException
- if there was an error in getting an instance
of any of the directories configured for the application.
ObjectNotFoundException
- no role found with the given nameprotected java.lang.String getDirectoryName(long directoryID) throws ObjectNotFoundException
ObjectNotFoundException
public void setApplicationDAO(ApplicationDAO applicationDAO)
public void setDirectoryDAO(DirectoryDAO directoryDAO)
public void setPasswordEncoderFactory(PasswordEncoderFactory passwordEncoderFactory)
public void setDirectoryManager(DirectoryManager directoryManager)
public void setPermissionManager(PermissionManager permissionManager)
public void setEventManager(com.atlassian.event.EventManager eventManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |