public class DefaultProjectComponentService extends Object implements ProjectComponentService
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_ASSIGNEE_TYPE
assignee type field name
|
static String |
FIELD_COMPONENT_LEAD
lead field name
|
static String |
FIELD_NAME
name field name
|
static String |
FIELD_PROJECT_ID
project ID field name
|
static String |
KEY_ASSIGNEE_TYPE_INVALID |
static String |
KEY_ID_NULL |
static String |
KEY_NAME_NOT_SET |
static String |
KEY_NAME_NOT_UNIQUE |
static String |
KEY_NO_SUCH_COMPONENT |
static String |
KEY_NO_SUCH_COMPONENT_TO_SWAP_WITH_ID |
static String |
KEY_NO_SUCH_COMPONENT_WITH_ID |
static String |
KEY_PROJECT_ID_NOT_FOUND |
static String |
KEY_PROJECT_ID_NULL |
static String |
KEY_USER_DOES_NOT_EXIST |
static String |
KEY_USER_NO_PERMISSION |
static String |
KEY_USER_NO_PERMISSION_WITH_USER |
Constructor and Description |
---|
DefaultProjectComponentService(JiraAuthenticationContext jiraAuthenticationContext,
PermissionManager permissionManager,
ProjectComponentManager projectComponentManager,
ProjectManager projectManager,
IssueManager issueManager,
UserManager userManager,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
ProjectComponent |
create(com.atlassian.crowd.embedded.api.User user,
ErrorCollection errorCollection,
String name,
String description,
String lead,
Long projectId)
Create a new ProjectComponent object associated with the project with the ID specified and with the values given.
|
ProjectComponent |
create(com.atlassian.crowd.embedded.api.User user,
ErrorCollection errorCollection,
String name,
String description,
String lead,
Long projectId,
Long assigneeType)
Create a project component with assignee type set as provided.
|
void |
deleteAndSwapComponentForIssues(JiraServiceContext context,
Long componentId,
Long swapComponentId) |
void |
deleteComponentForIssues(JiraServiceContext context,
Long componentId) |
ProjectComponent |
find(com.atlassian.crowd.embedded.api.User user,
ErrorCollection errorCollection,
Long id) |
Collection<ProjectComponent> |
findAllForProject(ErrorCollection errorCollection,
Long projectId) |
ProjectComponent |
update(com.atlassian.crowd.embedded.api.User user,
ErrorCollection errorCollection,
MutableProjectComponent component) |
protected void |
validateAssigneeType(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler,
Long assigneeType) |
protected void |
validateLead(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler,
String lead)
Validates lead.
|
protected void |
validateName(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler,
String oldName,
String newName,
Long projectId)
Validates newName.
|
protected void |
validateProjectId(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler,
Long projectId)
Validates project ID.
|
protected void |
verifyUserExists(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler,
String user)
Verifies that the user with the name specified is a valid JIRA user.
|
public static final String KEY_USER_NO_PERMISSION
public static final String KEY_USER_NO_PERMISSION_WITH_USER
public static final String KEY_NO_SUCH_COMPONENT
public static final String KEY_NO_SUCH_COMPONENT_WITH_ID
public static final String KEY_NO_SUCH_COMPONENT_TO_SWAP_WITH_ID
public static final String KEY_ID_NULL
public static final String KEY_PROJECT_ID_NULL
public static final String KEY_PROJECT_ID_NOT_FOUND
public static final String KEY_NAME_NOT_SET
public static final String KEY_NAME_NOT_UNIQUE
public static final String KEY_USER_DOES_NOT_EXIST
public static final String KEY_ASSIGNEE_TYPE_INVALID
public static final String FIELD_PROJECT_ID
public static final String FIELD_NAME
public static final String FIELD_COMPONENT_LEAD
public static final String FIELD_ASSIGNEE_TYPE
public DefaultProjectComponentService(JiraAuthenticationContext jiraAuthenticationContext, PermissionManager permissionManager, ProjectComponentManager projectComponentManager, ProjectManager projectManager, IssueManager issueManager, UserManager userManager, com.atlassian.event.api.EventPublisher eventPublisher)
public ProjectComponent create(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection, String name, String description, String lead, Long projectId)
create
in interface ProjectComponentService
user
- user performing this operationerrorCollection
- collection to add error messages to if validation and permission checks fail - String objectsname
- name of componentdescription
- description of componentlead
- user name associated with componentprojectId
- ID of project that component is associated withpublic ProjectComponent create(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection, String name, String description, String lead, Long projectId, Long assigneeType)
ProjectComponentService
create
in interface ProjectComponentService
ProjectComponent
public ProjectComponent find(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection, Long id)
find
in interface ProjectComponentService
user
- user performing this operation or null
for anonymous accesserrorCollection
- collection to add error messages to if validation and permission checks fail - String objectsid
- component iderrorCollection
should contain some error informationpublic Collection<ProjectComponent> findAllForProject(ErrorCollection errorCollection, Long projectId)
findAllForProject
in interface ProjectComponentService
public ProjectComponent update(com.atlassian.crowd.embedded.api.User user, ErrorCollection errorCollection, MutableProjectComponent component)
update
in interface ProjectComponentService
public void deleteComponentForIssues(JiraServiceContext context, Long componentId)
deleteComponentForIssues
in interface ProjectComponentService
public void deleteAndSwapComponentForIssues(JiraServiceContext context, Long componentId, Long swapComponentId)
deleteAndSwapComponentForIssues
in interface ProjectComponentService
protected void validateProjectId(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler, Long projectId)
handler
- validation and permission check handlerprojectId
- project IDprotected void validateName(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler, String oldName, String newName, Long projectId)
oldName
- old namenewName
- new nameprojectId
- project IDhandler
- validation and permission check handlerprotected void validateLead(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler, String lead)
lead
- leadhandler
- validation and permission check handlerprotected void validateAssigneeType(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler, Long assigneeType)
protected void verifyUserExists(com.atlassian.jira.bc.project.component.DefaultProjectComponentService.Handler handler, String user)
user
- user to verifyIllegalArgumentException
- if user does not existCopyright © 2002-2015 Atlassian. All Rights Reserved.