com.atlassian.jira.rpc.soap.service
Class ProjectRoleServiceImpl

java.lang.Object
  extended by com.atlassian.jira.rpc.soap.service.ProjectRoleServiceImpl
All Implemented Interfaces:
ProjectRoleService

public class ProjectRoleServiceImpl
extends java.lang.Object
implements ProjectRoleService


Constructor Summary
ProjectRoleServiceImpl(com.atlassian.jira.bc.projectroles.ProjectRoleService projectRoleService, com.atlassian.jira.project.ProjectManager projectManager, com.atlassian.jira.project.ProjectFactory projectFactory, RemoteEntityFactory remoteEntityFactory)
           
 
Method Summary
 void addActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String[] actors, RemoteProjectRole projectRole, RemoteProject project, java.lang.String actorType)
          Will add project role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.
 void addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String[] actorNames, RemoteProjectRole projectRole, java.lang.String type)
          Will add default role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.
 RemoteProjectRole createProjectRole(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole)
          Will create the project role based off the passed in projectRole.getName(), projectRole.getDescription() and checking the currentUser has the correct permissions to perform the create operation.
 void deleteProjectRole(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole, boolean confirm)
          Will delete the project role based off the passed in projectRole and checking the currentUser has the correct permissions to perform the delete operation.
 RemoteScheme[] getAssociatedNotificationSchemes(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole)
          Will get all notification scheme's that the specified projectRole is currently used in.
 RemoteScheme[] getAssociatedPermissionSchemes(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole)
          Will get all permission scheme's that the specified projectRole is currently used in.
 RemoteRoleActors getDefaultRoleActors(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole)
          Will return the project role actors based off the passed in projectRole checking the currentUser has the correct permissions to perform the get operation.
 RemoteProjectRole getProjectRole(com.atlassian.crowd.embedded.api.User currentUser, java.lang.Long id)
          Will return the project role based off the passed in id, and checking the currentUser has the correct permissions to perform the operation.
 RemoteProjectRoleActors getProjectRoleActors(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole, RemoteProject project)
          Will return the project role actors based off the passed in projectRole and project checking the currentUser has the correct permissions to perform the get operation.
 RemoteProjectRole[] getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser)
          Get all the ProjectRoles available in JIRA.
 boolean isProjectRoleNameUnique(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String name)
          Will tell you if a role name exists or not.
 void removeActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String[] actors, RemoteProjectRole projectRole, RemoteProject project, java.lang.String actorType)
          Will remove project role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.
 void removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String name, java.lang.String type)
          Will remove all role actors with the specified name and the specified type.
 void removeAllRoleActorsByProject(com.atlassian.crowd.embedded.api.User currentUser, RemoteProject project)
          Will remove all role actors associated with the specified project.
 void removeDefaultActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser, java.lang.String[] actors, RemoteProjectRole projectRole, java.lang.String actorType)
          Will remove default role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.
 void updateProjectRole(com.atlassian.crowd.embedded.api.User currentUser, RemoteProjectRole projectRole)
          Will update the project role based off the passed in projectRole and checking the currentUser has the correct permissions to perform the update operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectRoleServiceImpl

public ProjectRoleServiceImpl(com.atlassian.jira.bc.projectroles.ProjectRoleService projectRoleService,
                              com.atlassian.jira.project.ProjectManager projectManager,
                              com.atlassian.jira.project.ProjectFactory projectFactory,
                              RemoteEntityFactory remoteEntityFactory)
Method Detail

getProjectRoles

public RemoteProjectRole[] getProjectRoles(com.atlassian.crowd.embedded.api.User currentUser)
                                    throws RemoteException
Description copied from interface: ProjectRoleService
Get all the ProjectRoles available in JIRA. Currently this list is global.

Specified by:
getProjectRoles in interface ProjectRoleService
Returns:
The global list of project roles in JIRA
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

getProjectRole

public RemoteProjectRole getProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                        java.lang.Long id)
                                 throws RemoteException
Description copied from interface: ProjectRoleService
Will return the project role based off the passed in id, and checking the currentUser has the correct permissions to perform the operation.

Specified by:
getProjectRole in interface ProjectRoleService
Returns:
the ProjectRole for the given id
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

createProjectRole

public RemoteProjectRole createProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                           RemoteProjectRole projectRole)
                                    throws RemoteException
Description copied from interface: ProjectRoleService
Will create the project role based off the passed in projectRole.getName(), projectRole.getDescription() and checking the currentUser has the correct permissions to perform the create operation.

Specified by:
createProjectRole in interface ProjectRoleService
projectRole - can not be null and will contain the name and description for the project role to create
Returns:
the ProjectRole object that was created
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

isProjectRoleNameUnique

public boolean isProjectRoleNameUnique(com.atlassian.crowd.embedded.api.User currentUser,
                                       java.lang.String name)
                                throws RemoteException
Description copied from interface: ProjectRoleService
Will tell you if a role name exists or not.

Specified by:
isProjectRoleNameUnique in interface ProjectRoleService
name - the name of the project role to check
Returns:
true if unique, false if one already exists with that name
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

deleteProjectRole

public void deleteProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                              RemoteProjectRole projectRole,
                              boolean confirm)
                       throws RemoteException
Description copied from interface: ProjectRoleService
Will delete the project role based off the passed in projectRole and checking the currentUser has the correct permissions to perform the delete operation. This will also delete all ProjectRoleActor associations that it is the parent of. If the confirm flag is false then this method will check to see if the role is associated with any permission or notification schemes and if so it will throw an exception informing you which schemes and it will not perform the delete. To force a delete pass the confirm flag in as true.

Specified by:
deleteProjectRole in interface ProjectRoleService
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException - thrown if the confirm flag is false and the role is used by a notification or permission scheme.

addActorsToProjectRole

public void addActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                   java.lang.String[] actors,
                                   RemoteProjectRole projectRole,
                                   RemoteProject project,
                                   java.lang.String actorType)
                            throws RemoteException
Description copied from interface: ProjectRoleService
Will add project role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.

Specified by:
addActorsToProjectRole in interface ProjectRoleService
actors - is a list of strings that they RoleActor impl should be able to handle
projectRole - is the project role to associate with
project - is the project to associate with
actorType - is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE ("atlassian-user-role-actor"), GroupRoleActor.TYPE ("atlassian-group-role-actor"))
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

removeActorsFromProjectRole

public void removeActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                        java.lang.String[] actors,
                                        RemoteProjectRole projectRole,
                                        RemoteProject project,
                                        java.lang.String actorType)
                                 throws RemoteException
Description copied from interface: ProjectRoleService
Will remove project role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.

Specified by:
removeActorsFromProjectRole in interface ProjectRoleService
actors - is a list of strings that the RoleActor impl should be able to handle
projectRole - is the project role to associate with
project - is the project to associate with
actorType - is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE ("atlassian-user-role-actor"), GroupRoleActor.TYPE ("atlassian-group-role-actor"))
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

updateProjectRole

public void updateProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                              RemoteProjectRole projectRole)
                       throws RemoteException
Description copied from interface: ProjectRoleService
Will update the project role based off the passed in projectRole and checking the currentUser has the correct permissions to perform the update operation.

Specified by:
updateProjectRole in interface ProjectRoleService
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

getProjectRoleActors

public RemoteProjectRoleActors getProjectRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
                                                    RemoteProjectRole projectRole,
                                                    RemoteProject project)
                                             throws RemoteException
Description copied from interface: ProjectRoleService
Will return the project role actors based off the passed in projectRole and project checking the currentUser has the correct permissions to perform the get operation.

Specified by:
getProjectRoleActors in interface ProjectRoleService
Returns:
the ProjectRoleActor representing the projectRole and project
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

getDefaultRoleActors

public RemoteRoleActors getDefaultRoleActors(com.atlassian.crowd.embedded.api.User currentUser,
                                             RemoteProjectRole projectRole)
                                      throws RemoteException
Description copied from interface: ProjectRoleService
Will return the project role actors based off the passed in projectRole checking the currentUser has the correct permissions to perform the get operation.

Specified by:
getDefaultRoleActors in interface ProjectRoleService
Returns:
the remote default role actors
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

addDefaultActorsToProjectRole

public void addDefaultActorsToProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                          java.lang.String[] actorNames,
                                          RemoteProjectRole projectRole,
                                          java.lang.String type)
                                   throws RemoteException
Description copied from interface: ProjectRoleService
Will add default role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.

Specified by:
addDefaultActorsToProjectRole in interface ProjectRoleService
actorNames - is a list of strings that the RoleActor impl should be able to handle
projectRole - is the project role to associate with
type - is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

removeDefaultActorsFromProjectRole

public void removeDefaultActorsFromProjectRole(com.atlassian.crowd.embedded.api.User currentUser,
                                               java.lang.String[] actors,
                                               RemoteProjectRole projectRole,
                                               java.lang.String actorType)
                                        throws RemoteException
Description copied from interface: ProjectRoleService
Will remove default role actor associations based off the passed in actors and checking the currentUser has the correct permissions to perform the update operation.

Specified by:
removeDefaultActorsFromProjectRole in interface ProjectRoleService
actors - is a list of strings that they RoleActor impl should be able to handle
projectRole - is the project role to associate with
actorType - is a type that defines the type of role actor to instantiate (ex./ UserRoleActor.TYPE, GroupRoleActor.TYPE)
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

removeAllRoleActorsByNameAndType

public void removeAllRoleActorsByNameAndType(com.atlassian.crowd.embedded.api.User currentUser,
                                             java.lang.String name,
                                             java.lang.String type)
                                      throws RemoteException
Description copied from interface: ProjectRoleService
Will remove all role actors with the specified name and the specified type. This method should be used to clean up after the actual subject of the role actor has been deleted (ex. deleting a user from the system).

Specified by:
removeAllRoleActorsByNameAndType in interface ProjectRoleService
name - this is the name that the role actor is stored under (ex. username of 'admin', group name of 'jira-users')
type - this is the role type parameter, (ex. GroupRoleActor.TYPE, UserRoleActor.TYPE)
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

removeAllRoleActorsByProject

public void removeAllRoleActorsByProject(com.atlassian.crowd.embedded.api.User currentUser,
                                         RemoteProject project)
                                  throws RemoteException
Description copied from interface: ProjectRoleService
Will remove all role actors associated with the specified project. This method should be used to clean up just before the actual project has been deleted (ex. deleting a project from the system).

Specified by:
removeAllRoleActorsByProject in interface ProjectRoleService
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

getAssociatedNotificationSchemes

public RemoteScheme[] getAssociatedNotificationSchemes(com.atlassian.crowd.embedded.api.User currentUser,
                                                       RemoteProjectRole projectRole)
                                                throws RemoteException
Description copied from interface: ProjectRoleService
Will get all notification scheme's that the specified projectRole is currently used in.

Specified by:
getAssociatedNotificationSchemes in interface ProjectRoleService
Returns:
a collection of schemes
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException

getAssociatedPermissionSchemes

public RemoteScheme[] getAssociatedPermissionSchemes(com.atlassian.crowd.embedded.api.User currentUser,
                                                     RemoteProjectRole projectRole)
                                              throws RemoteException
Description copied from interface: ProjectRoleService
Will get all permission scheme's that the specified projectRole is currently used in.

Specified by:
getAssociatedPermissionSchemes in interface ProjectRoleService
Returns:
a collection of schemes
Throws:
RemoteValidationException - thrown if and invalid parameter is passed or if the currentUser does not have permission to perform the operation.
RemoteException


Copyright © 2004-2011 Atlassian. All Rights Reserved.