public class DefaultRemoteIssueLinkService extends Object implements RemoteIssueLinkService
RemoteIssueLinkService.RemoteIssueLinkService.CreateValidationResult, RemoteIssueLinkService.DeleteByGlobalIdValidationResult, RemoteIssueLinkService.DeleteValidationResult, RemoteIssueLinkService.RemoteIssueLinkListResult, RemoteIssueLinkService.RemoteIssueLinkResult, RemoteIssueLinkService.UpdateValidationResult| Constructor and Description |
|---|
DefaultRemoteIssueLinkService(RemoteIssueLinkManager remoteIssueLinkManager,
IssueService issueService,
IssueManager issueManager,
IssueLinkManager issueLinkManager,
I18nHelper.BeanFactory beanFactory,
PermissionManager permissionManager) |
| Modifier and Type | Method and Description |
|---|---|
RemoteIssueLinkService.RemoteIssueLinkResult |
create(ApplicationUser user,
RemoteIssueLinkService.CreateValidationResult createValidationResult)
Stores the given remote issue link in the JIRA datastore, if the current user has permission to do so.
|
void |
delete(ApplicationUser user,
RemoteIssueLinkService.DeleteValidationResult deleteValidationResult)
Deletes the remote issue link with the given id from the JIRA datastore, if the current user has permission to do so.
|
void |
deleteByGlobalId(ApplicationUser user,
RemoteIssueLinkService.DeleteByGlobalIdValidationResult validationResult)
Deletes the remote issue link that links with the given JIRA issue and has the given global id, if the current
user has permission to do so.
|
RemoteIssueLinkService.RemoteIssueLinkListResult |
findRemoteIssueLinksByGlobalId(ApplicationUser user,
Collection<String> globalIds)
Retrieves the list of remote issue links that have any of the given globalIds.
|
RemoteIssueLinkService.RemoteIssueLinkResult |
getRemoteIssueLink(ApplicationUser user,
Long remoteIssueLinkId)
Retrieves the remote issue link with the given id.
|
RemoteIssueLinkService.RemoteIssueLinkResult |
getRemoteIssueLinkByGlobalId(ApplicationUser user,
Issue issue,
String globalId)
Retrieves the remote issue link that links with the given JIRA issue and has the given globalId.
|
RemoteIssueLinkService.RemoteIssueLinkListResult |
getRemoteIssueLinksForIssue(ApplicationUser user,
Issue issue)
Retrieves the remote issue links that link with the given JIRA issue.
|
RemoteIssueLinkService.RemoteIssueLinkResult |
update(ApplicationUser user,
RemoteIssueLinkService.UpdateValidationResult updateValidationResult)
Updates the given remote issue link in the JIRA datastore, if the current user has permission to do so.
|
RemoteIssueLinkService.CreateValidationResult |
validateCreate(ApplicationUser user,
RemoteIssueLink remoteIssueLink)
Validates parameters and checks permissions, and if all checks pass it will create a
RemoteIssueLinkService.CreateValidationResult that can be passed to the #create(User, CreateValidationResult) method. |
RemoteIssueLinkService.DeleteValidationResult |
validateDelete(ApplicationUser user,
Long remoteIssueLinkId)
Validates parameters and checks permissions, and if all checks pass it will create a
RemoteIssueLinkService.DeleteValidationResult that can be passed to the #delete(User, DeleteValidationResult) method. |
RemoteIssueLinkService.DeleteByGlobalIdValidationResult |
validateDeleteByGlobalId(ApplicationUser user,
Issue issue,
String globalId)
Validates parameters and checks permissions, and if all checks pass it will create a
RemoteIssueLinkService.DeleteByGlobalIdValidationResult that can be passed to the
#deleteByGlobalId(User, DeleteByGlobalIdValidationResult) method. |
RemoteIssueLinkService.UpdateValidationResult |
validateUpdate(ApplicationUser user,
RemoteIssueLink remoteIssueLink)
Validates parameters and checks permissions, and if all checks pass it will create a
RemoteIssueLinkService.UpdateValidationResult that can be passed to the #update(User, UpdateValidationResult) method. |
public DefaultRemoteIssueLinkService(RemoteIssueLinkManager remoteIssueLinkManager, IssueService issueService, IssueManager issueManager, IssueLinkManager issueLinkManager, I18nHelper.BeanFactory beanFactory, PermissionManager permissionManager)
public RemoteIssueLinkService.RemoteIssueLinkResult getRemoteIssueLink(ApplicationUser user, Long remoteIssueLinkId)
RemoteIssueLinkServicegetRemoteIssueLink in interface RemoteIssueLinkServiceuser - who the permission checks will be run against (can be null, indicating an anonymous user).remoteIssueLinkId - the database ID of the remote issue linkRemoteIssueLink if all went well. If there was an error the remote issue link
will be null and the error collection will contain details of what went wrong. Some possible error cases include
a remote issue link with the given id not existing, issue linking being disabled, or the user not having
Permissions.BROWSE permission for the linked issue.public RemoteIssueLinkService.RemoteIssueLinkListResult getRemoteIssueLinksForIssue(ApplicationUser user, Issue issue)
RemoteIssueLinkServicegetRemoteIssueLinksForIssue in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).issue - the issue to get the remote issue links forRemoteIssueLinks if all went well. If no remote issue links are
stored against the issue, the list will be empty. If there was an error the remote issue links list will be null
and the error collection will contain details of what went wrong. Some possible error cases include the given
issue not existing, linking being disabled, or the user not having
Permissions.BROWSE permission for the linked issue.public RemoteIssueLinkService.RemoteIssueLinkResult getRemoteIssueLinkByGlobalId(ApplicationUser user, Issue issue, String globalId)
RemoteIssueLinkServicegetRemoteIssueLinkByGlobalId in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).issue - the issue to get the remote issue link forglobalId - the globalId to get the remote issue link forRemoteIssueLink if all went well. If there was an error the remote issue link
will be null and the error collection will contain details of what went wrong. Some possible error cases include
a remote issue link with the given globalId not existing, issue linking being disabled, or the user not having
Permissions.BROWSE permission for the linked issue.public RemoteIssueLinkService.RemoteIssueLinkListResult findRemoteIssueLinksByGlobalId(ApplicationUser user, Collection<String> globalIds)
RemoteIssueLinkServicefindRemoteIssueLinksByGlobalId in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).globalIds - the globalIds to get the remote issue links for. Should not contain null values.RemoteIssueLinks if all went well. If no remote issue links are
stored with any of the given globalIds, the list will be empty. If there was an error the remote issue links list will be null
and the error collection will contain details of what went wrong. Some possible error cases include the given collection
of globalIds is empty, issue linking being disabled, the user not having permissions, or any of the globalIds is null.
Permissions.BROWSE permission for the linked issue.public RemoteIssueLinkService.CreateValidationResult validateCreate(ApplicationUser user, RemoteIssueLink remoteIssueLink)
RemoteIssueLinkServiceRemoteIssueLinkService.CreateValidationResult that can be passed to the #create(User, CreateValidationResult) method.
If any validation fails the result will contain a null RemoteIssueLink.
validateCreate in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).remoteIssueLink - the remote issue link to createRemoteIssueLink, otherwise the RemoteIssueLink will be null.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation.public RemoteIssueLinkService.RemoteIssueLinkResult create(ApplicationUser user, RemoteIssueLinkService.CreateValidationResult createValidationResult)
RemoteIssueLinkServicecreate in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).createValidationResult - contains the remote issue link to store. This should have been created by the
#validateCreate(User, RemoteIssueLink) method. The result must have
ServiceResult.isValid() return true. If false this method will throw an
IllegalStateException.RemoteIssueLink if all went well. If there was an error
creating the remote issue link then the remote issue link will be null and the error collection will contain details of what
went wrong.public RemoteIssueLinkService.UpdateValidationResult validateUpdate(ApplicationUser user, RemoteIssueLink remoteIssueLink)
RemoteIssueLinkServiceRemoteIssueLinkService.UpdateValidationResult that can be passed to the #update(User, UpdateValidationResult) method.
Remote link are updated using all of the values in the given remote issue link object. Null values are written as null, and must adhere to the required field constraints.
If any validation fails the result will contain a null RemoteIssueLink.
validateUpdate in interface RemoteIssueLinkServiceuser - user who the permission checks will be run against (can be null, indicating an anonymous user).remoteIssueLink - the remote issue link to updateRemoteIssueLink, otherwise the RemoteIssueLink will be null.
The result also contains an error collection that will contain any error messages that may have been generated
when performing the operation.public RemoteIssueLinkService.RemoteIssueLinkResult update(ApplicationUser user, RemoteIssueLinkService.UpdateValidationResult updateValidationResult)
RemoteIssueLinkServiceupdate in interface RemoteIssueLinkServiceuser - user user who the permission checks will be run against (can be null, indicating an anonymous user).updateValidationResult - contains the remote issue link to update. This should have been created by the
#validateUpdate(User, RemoteIssueLink) method. The result must have
ServiceResult.isValid() return true. If false this method will throw an
IllegalStateException. The remote issue link is updated using all of the values in this object. Null values are written
as null, and must adhere to the required field constraints.RemoteIssueLink if all went well. If there was an error
updating the remote issue link then the remote issue link will be null and the error collection will contain details of what
went wrong.public RemoteIssueLinkService.DeleteValidationResult validateDelete(ApplicationUser user, Long remoteIssueLinkId)
RemoteIssueLinkServiceRemoteIssueLinkService.DeleteValidationResult that can be passed to the #delete(User, DeleteValidationResult) method.validateDelete in interface RemoteIssueLinkServiceuser - who the permission checks will be run against (can be null, indicating an anonymous user).remoteIssueLinkId - the id of the remote issue link to deletepublic void delete(ApplicationUser user, RemoteIssueLinkService.DeleteValidationResult deleteValidationResult)
RemoteIssueLinkServicedelete in interface RemoteIssueLinkServiceuser - user user who the permission checks will be run against (can be null, indicating an anonymous user).deleteValidationResult - contains the remote issue link id to delete. This should have been created by the
#validateDelete(User, Long) method. The result must have
ServiceResult.isValid() return true. If false this method will throw an
IllegalStateException.public RemoteIssueLinkService.DeleteByGlobalIdValidationResult validateDeleteByGlobalId(ApplicationUser user, Issue issue, String globalId)
RemoteIssueLinkServiceRemoteIssueLinkService.DeleteByGlobalIdValidationResult that can be passed to the
#deleteByGlobalId(User, DeleteByGlobalIdValidationResult) method.validateDeleteByGlobalId in interface RemoteIssueLinkServiceuser - who the permission checks will be run against (can be null, indicating an anonymous user).issue - the issue to get the remote issue link forglobalId - the global id to get the remote issue link forpublic void deleteByGlobalId(ApplicationUser user, RemoteIssueLinkService.DeleteByGlobalIdValidationResult validationResult)
RemoteIssueLinkServicedeleteByGlobalId in interface RemoteIssueLinkServiceuser - user user who the permission checks will be run against (can be null, indicating an anonymous user).validationResult - contains the remote issue link id to delete. This should have been created by the
#validateDeleteByGlobalId(User, Issue, String) method. The result must have
ServiceResult.isValid() return true. If false this method will throw an
IllegalStateException.Copyright © 2002-2022 Atlassian. All Rights Reserved.