com.atlassian.jira.security.roles.actor
Class UserRoleActorFactory

java.lang.Object
  extended by com.atlassian.jira.security.roles.actor.UserRoleActorFactory
All Implemented Interfaces:
RoleActorFactory

public class UserRoleActorFactory
extends java.lang.Object
implements RoleActorFactory

Responsible for construction of UserRoleActor instances. Also optimises the lookup where we have many users in a particular role for a project by doing a map lookup based on the username.

Access to the actual User instance is via a UserFactory so we can unit-test. The production dependency is set in the default ctor.


Field Summary
static java.lang.String TYPE
           
 
Constructor Summary
UserRoleActorFactory()
           
 
Method Summary
 ProjectRoleActor createRoleActor(java.lang.Long id, java.lang.Long projectRoleId, java.lang.Long projectId, java.lang.String type, java.lang.String parameter)
          Create instances of the ProjectRoleActor
 java.util.Set optimizeRoleActorSet(java.util.Set 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values
Constructor Detail

UserRoleActorFactory

public UserRoleActorFactory()
Method Detail

createRoleActor

public ProjectRoleActor createRoleActor(java.lang.Long id,
                                        java.lang.Long projectRoleId,
                                        java.lang.Long projectId,
                                        java.lang.String type,
                                        java.lang.String parameter)
Description copied from interface: RoleActorFactory
Create instances of the ProjectRoleActor

Specified by:
createRoleActor in interface RoleActorFactory
Returns:

optimizeRoleActorSet

public java.util.Set optimizeRoleActorSet(java.util.Set roleActors)
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 interface RoleActorFactory
Parameters:
roleActors - a Set of RoleActor instances
Returns:
the optimized Set perhaps containing aggregations that can be queried more efficiently.


Copyright © 2002-2010 Atlassian. All Rights Reserved.