Package com.atlassian.jira.mock
Class MockProjectRoleManager.MockRoleActorFactory
java.lang.Object
com.atlassian.jira.mock.MockProjectRoleManager.MockRoleActorFactory
- All Implemented Interfaces:
RoleActorFactory
- Enclosing class:
- MockProjectRoleManager
public static class MockProjectRoleManager.MockRoleActorFactory
extends Object
implements RoleActorFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate instance of the ProjectRoleActor representing a role actor stored in the database.Find and return all role actors for the given user.optimizeRoleActorSet
(Set<RoleActor> roleActors) if RoleActors can be aggregated and queried in a more optimised way, then optimize the set to reduce its size so we reduce the number of iterations across the set.
-
Constructor Details
-
MockRoleActorFactory
public MockRoleActorFactory()
-
-
Method Details
-
createRoleActor
public ProjectRoleActor createRoleActor(Long id, Long projectRoleId, Long projectId, String type, String parameter) throws RoleActorDoesNotExistException Description copied from interface:RoleActorFactory
Create instance of the ProjectRoleActor representing a role actor stored in the database. In order to add a new role actor please pass a null id.- Specified by:
createRoleActor
in interfaceRoleActorFactory
- Parameters:
id
- of the ProjectRoleActorprojectRoleId
- of the ProjectRole associated with the actor.projectId
- of the Project associated with the actor.type
- of the actor which determines the implementation.parameter
- saying with which exact entity is actor associated ie. group name, user name.- Returns:
- implementation representing ProjectRoleActor.
- Throws:
RoleActorDoesNotExistException
-
optimizeRoleActorSet
Description copied from interface:RoleActorFactory
if RoleActors can be aggregated and queried in a more optimised way, then optimize the set to reduce its size so we reduce the number of iterations across the set.- Specified by:
optimizeRoleActorSet
in interfaceRoleActorFactory
- Parameters:
roleActors
- a Set of RoleActor instances- Returns:
- the optimized Set perhaps containing aggregations that can be queried more efficiently.
-
getAllRoleActorsForUser
Description copied from interface:RoleActorFactory
Find and return all role actors for the given user.- Specified by:
getAllRoleActorsForUser
in interfaceRoleActorFactory
- Parameters:
user
- for which actors will be obtained- Returns:
- a set of actors being associated with the given user or empty set if none found.
-