public class MockIssueManager extends Object implements IssueManager
Constructor and Description |
---|
MockIssueManager() |
Modifier and Type | Method and Description |
---|---|
void |
addIssue(org.ofbiz.core.entity.GenericValue issueGV) |
void |
addIssue(MutableIssue issue) |
void |
addVersion(org.ofbiz.core.entity.GenericValue version) |
Issue |
archiveIssue(ApplicationUser user,
Issue issue,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will archive the issue.
|
boolean |
atLeastOneIssueExists()
Return true if an issue exists.
|
org.ofbiz.core.entity.GenericValue |
createIssue(ApplicationUser remoteUser,
Issue issue)
Persists a new issue.
|
org.ofbiz.core.entity.GenericValue |
createIssue(ApplicationUser remoteUser,
Map fields)
Creates an issue.
|
org.ofbiz.core.entity.GenericValue |
createIssue(String remoteUserName,
Map fields)
Creates an issue.
|
Issue |
createIssueObject(ApplicationUser remoteUser,
Issue issue)
Creates an issue.
|
Issue |
createIssueObject(ApplicationUser remoteUser,
Map<String,Object> fields)
Creates an issue.
|
Issue |
createIssueObject(String remoteUserName,
Map<String,Object> fields)
Creates an issue.
|
void |
deleteIssue(ApplicationUser user,
Issue issue,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will delete an issue from JIRA.
|
void |
deleteIssue(ApplicationUser user,
MutableIssue issue,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will delete an issue from JIRA.
|
void |
deleteIssueNoEvent(Issue issue)
Delete issue without firing any events, or sending notifications.
|
void |
deleteIssueNoEvent(MutableIssue issue)
Delete issue without firing any events, or sending notifications.
|
List |
execute(SearchRequest searchRequest,
ApplicationUser searcher)
Takes a search request object and returns a list of issues that match the search request
|
Issue |
findMovedIssue(String oldIssueKey)
Returns an issue that has been moved by searching on the old issue key.
|
Set<String> |
getAllIssueKeys(Long issueId)
Returns all issue keys that are associated with
Issue . |
long |
getCacheHitsCount() |
long |
getCacheMaxSize() |
long |
getCacheMissCount() |
long |
getCacheSize() |
List |
getEntitiesByIssue(String relationName,
org.ofbiz.core.entity.GenericValue issue)
Get a list of entities (versions, components etc) related to this issue.
|
List |
getEntitiesByIssueObject(String relationName,
Issue issue)
Get a list of entities (versions, components etc) related to this issue.
|
Set<Long> |
getIdsOfMissingIssues(Set<Long> issueIds)
Check existence of issues for the given set of IDs
|
org.ofbiz.core.entity.GenericValue |
getIssue(Long id)
Retrieves an issue by its id.
|
org.ofbiz.core.entity.GenericValue |
getIssue(String key)
Retrieves the issue as a
GenericValue with the given key. |
MutableIssue |
getIssueByCurrentKey(String key)
Retrieves the
Issue that has the given key, or null if no such Issue exists. |
MutableIssue |
getIssueByKeyIgnoreCase(String key)
Retrieves the
Issue that has the given key, or null if no such Issue exists. |
org.ofbiz.core.entity.GenericValue |
getIssueByWorkflow(Long wfid)
Retrieves an issue
GenericValue given a workflow ID. |
long |
getIssueCount()
Returns the number of issues.
|
long |
getIssueCountForProject(Long projectId)
Returns the number of issues that exist for the provided project id.
|
Collection |
getIssueIdsForProject(Long projectId)
Returns all issue ids for a particular project.
|
MutableIssue |
getIssueObject(Long id)
Retrieves an issue by id.
|
MutableIssue |
getIssueObject(String key)
Retrieves the
Issue that has the given key, or null if no such Issue exists. |
MutableIssue |
getIssueObjectByWorkflow(Long workflowId)
Retrieves an issue given a workflow ID.
|
List<Issue> |
getIssueObjects(Collection<Long> ids)
Get issues with the following ids.
|
List<Issue> |
getIssueObjectsByEntity(String relationName,
org.ofbiz.core.entity.GenericValue entity)
Get a list of issues related to an entity (version, component etc).
|
List |
getIssues(Collection ids)
Get issues with the following ids.
|
List |
getIssuesByEntity(String relationName,
org.ofbiz.core.entity.GenericValue entity)
Get a list of issues related to an entity (version, component etc).
|
Set<String> |
getKeysOfMissingIssues(Set<String> issueKeys)
Check existence of issues for the given set of keys
|
List |
getProjectIssues(org.ofbiz.core.entity.GenericValue project)
Get all the issues for a given project.
|
Set<Pair<Long,String>> |
getProjectIssueTypePairsByIds(Set<Long> issueIds)
Returns a set of project ID / issue type combinations that given issue IDs cover.
|
Set<Pair<Long,String>> |
getProjectIssueTypePairsByKeys(Set<String> issueKeys)
Returns a set of project ID / issue type combinations that given issue keys cover.
|
long |
getUnassignedIssueCount()
Returns the number of unassigned issues.
|
List<Issue> |
getVotedIssues(ApplicationUser user)
Get a list of issues that the user has voted on and can see.
|
List<Issue> |
getVotedIssuesOverrideSecurity(ApplicationUser user)
Get a list of issues that the user has voted on.
|
List<Issue> |
getWatchedIssues(ApplicationUser user)
Get a list of issues that the user is watching and can see.
|
List<Issue> |
getWatchedIssuesOverrideSecurity(ApplicationUser user)
Get a list of issues that the user is watching
|
List<ApplicationUser> |
getWatchers(Issue issue)
Return a list of watchers for a particular issue.
|
List<ApplicationUser> |
getWatchersFor(Issue issue)
Return a list of watchers for a particular issue.
|
boolean |
hasUnassignedIssues()
Returns a boolean indicating whether there are unassigned issues.
|
boolean |
isEditable(Issue issue)
Returns
true if the issue can be edited. |
boolean |
isEditable(Issue issue,
ApplicationUser user)
Returns
true if the issue can be edited by the current user. |
boolean |
isEditable(Issue issue,
String nextStatusId)
Returns
true if the issue can be edited after action. |
boolean |
isExistingIssueKey(String issueKey)
Returns true if issue with a given key exists (it looks for issues having current issue key set for the value,
and moved issue keys that used the key).
|
void |
recordMovedIssueKey(Issue oldIssue)
Used internally when we want to record that an Issue has changed its Issue key (because it has moved project).
|
void |
refresh() |
void |
refresh(org.ofbiz.core.entity.GenericValue issue) |
void |
refreshParents(String associationName,
org.ofbiz.core.entity.GenericValue child) |
void |
resetCacheStats() |
Issue |
restoreIssue(ApplicationUser user,
Issue issue,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will restore an archived issue.
|
void |
setCacheMaxSize(long maxSize) |
void |
setEditable(boolean editable) |
void |
setEditableAfterAction(boolean editableAfterAction) |
Issue |
updateIssue(ApplicationUser user,
MutableIssue issue,
EventDispatchOption eventDispatchOption,
boolean sendMail)
This method will store the provided issue to the JIRA datastore.
|
Issue |
updateIssue(ApplicationUser user,
MutableIssue issue,
UpdateIssueRequest updateIssueRequest)
This method will store the provided issue to the JIRA datastore.
|
public org.ofbiz.core.entity.GenericValue getIssue(Long id) throws DataAccessException
IssueManager
getIssue
in interface IssueManager
id
- Issue ID.GenericValue
.DataAccessException
- if there is an error in the Data Access Layer.public org.ofbiz.core.entity.GenericValue getIssue(String key) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
GenericValue
with the given key.getIssue
in interface IssueManager
key
- the issue key.GenericValue
.org.ofbiz.core.entity.GenericEntityException
- if there is a problem getting the datapublic boolean isExistingIssueKey(String issueKey) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
isExistingIssueKey
in interface IssueManager
org.ofbiz.core.entity.GenericEntityException
public List getIssues(Collection ids)
IssueManager
getIssues
in interface IssueManager
ids
- Issue IDs.GenericValue
spublic org.ofbiz.core.entity.GenericValue getIssueByWorkflow(Long wfid) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
GenericValue
given a workflow ID. This is used when transitioning
through the various steps of a workflow.getIssueByWorkflow
in interface IssueManager
wfid
- workflow ID.GenericValue
.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public MutableIssue getIssueObjectByWorkflow(Long workflowId) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getIssueObjectByWorkflow
in interface IssueManager
workflowId
- workflow ID.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public MutableIssue getIssueObject(Long id) throws DataAccessException
IssueManager
getIssueObject
in interface IssueManager
id
- the idMutableIssue
DataAccessException
- if there is an error in the Data Access Layer.public MutableIssue getIssueObject(String key) throws DataAccessException
IssueManager
Issue
that has the given key, or null if no such Issue exists.
This method will always return a new instance of an issue object if the issue exists.
getIssueObject
in interface IssueManager
key
- The Issue key.MutableIssue
with the given key, or null if no such Issue exists.DataAccessException
- if there is an error in the Data Access Layer.public MutableIssue getIssueByKeyIgnoreCase(String key) throws DataAccessException
IssueManager
Issue
that has the given key, or null if no such Issue exists.
This method will ignore case of issue key.
getIssueByKeyIgnoreCase
in interface IssueManager
key
- The Issue key.MutableIssue
with the given key, or null if no such Issue exists.DataAccessException
- if there is an error in the Data Access Layer.public MutableIssue getIssueByCurrentKey(String key) throws DataAccessException
IssueManager
Issue
that has the given key, or null if no such Issue exists.
This method will strictly only return the issue which has current issue key equal to the one given.
getIssueByCurrentKey
in interface IssueManager
key
- The Issue key.MutableIssue
with the given key, or null if no such Issue exists.DataAccessException
- if there is an error in the Data Access Layer.public List<Issue> getIssueObjects(Collection<Long> ids)
IssueManager
getIssueObjects
in interface IssueManager
ids
- Issue IDs.MutableIssue
spublic List getEntitiesByIssue(String relationName, org.ofbiz.core.entity.GenericValue issue) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getEntitiesByIssue
in interface IssueManager
relationName
- A IssueRelationConstants
string indicating some issue relationissue
- Issue to considerGenericValue
s associated with the issue.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public List getEntitiesByIssueObject(String relationName, Issue issue) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getEntitiesByIssueObject
in interface IssueManager
relationName
- A IssueRelationConstants
string indicating some issue relationissue
- Issue to considerGenericValue
s associated with the issue.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public List getIssuesByEntity(String relationName, org.ofbiz.core.entity.GenericValue entity) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getIssuesByEntity
in interface IssueManager
relationName
- A IssueRelationConstants
string indicating some relation of entityentity
- The entity related to the issues we're afterGenericValue
s associated with an entity.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public List<Issue> getIssueObjectsByEntity(String relationName, org.ofbiz.core.entity.GenericValue entity) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getIssueObjectsByEntity
in interface IssueManager
relationName
- A IssueRelationConstants
string indicating some relation of entityentity
- The entity related to the issues we're afterMutableIssue
s associated with an entity.org.ofbiz.core.entity.GenericEntityException
- if it failed to get the list of issues.public Set<String> getAllIssueKeys(Long issueId)
IssueManager
Issue
.getAllIssueKeys
in interface IssueManager
ChangeHistoryManager.getPreviousIssueKeys(Long)
public Issue createIssueObject(String remoteUserName, Map<String,Object> fields) throws CreateException
IssueManager
createIssueObject
in interface IssueManager
remoteUserName
- Issue creatorfields
- A map of the issue's immediate field values. See the Issue definition in entitymodel.xml for values.CreateException
- If JIRA is unable to create the issue.public Issue createIssueObject(ApplicationUser remoteUser, Map<String,Object> fields) throws CreateException
IssueManager
createIssueObject
in interface IssueManager
remoteUser
- Issue creatorfields
- A map of the issue's immediate field values. See the Issue definition in entitymodel.xml for values.CreateException
- If JIRA is unable to create the issue.public org.ofbiz.core.entity.GenericValue createIssue(String remoteUserName, Map fields)
IssueManager
createIssue
in interface IssueManager
remoteUserName
- Issue creatorfields
- A map of the issue's immediate field values. See the Issue definition in entitymodel.xml for values.public org.ofbiz.core.entity.GenericValue createIssue(ApplicationUser remoteUser, Map fields) throws CreateException
IssueManager
createIssue
in interface IssueManager
remoteUser
- Issue creatorfields
- A map of the issue's immediate field values. See the Issue definition in entitymodel.xml for values.CreateException
- If JIRA is unable to create the issue.public org.ofbiz.core.entity.GenericValue createIssue(ApplicationUser remoteUser, Issue issue) throws CreateException
IssueManager
createIssue
in interface IssueManager
remoteUser
- Issue creatorissue
- The new issue.CreateException
- If JIRA is unable to create the issue.public Issue createIssueObject(ApplicationUser remoteUser, Issue issue) throws CreateException
IssueManager
createIssueObject
in interface IssueManager
remoteUser
- Issue creatorissue
- The new issue.CreateException
- If JIRA is unable to create the issue.public Issue updateIssue(ApplicationUser user, MutableIssue issue, UpdateIssueRequest updateIssueRequest)
IssueManager
This method should be used if you want to exert more control over what happens when JIRA updates an issue.
updateIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to updateupdateIssueRequest
- details about how to perform the update, including user context, event dispatch strategy
and history metadataUpdateIssueRequest
public Issue updateIssue(ApplicationUser user, MutableIssue issue, EventDispatchOption eventDispatchOption, boolean sendMail)
IssueManager
The issue will be saved and re-indexed unless EventDispatchOption.DO_NOT_DISPATCH
is specified.
This method performs no permission checks.
This method should be used if you want to exert more control over what happens when JIRA updates an issue. This
method will allow you to specify if an event is dispatched and if so which event is dispatched, see
EventDispatchOption
. This method also allows you to specify if email
notifications should be send to notify users of the update.
updateIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to updateeventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.public Issue archiveIssue(ApplicationUser user, Issue issue, EventDispatchOption eventDispatchOption, boolean sendMail) throws ArchiveException
IssueManager
The issue will be marked as archived and removed from current index. This method performs archiving licence check and permission checks.
This method also allows you to specify if email notifications should be send to notify users of the update.
archiveIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to updateeventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.ArchiveException
public Issue restoreIssue(ApplicationUser user, Issue issue, EventDispatchOption eventDispatchOption, boolean sendMail) throws ArchiveException
IssueManager
The issue will be moved back to index. This method performs archiving licence check and permission checks.
This method also allows you to specify if email notifications should be send to notify users of the update.
restoreIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to updateeventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.ArchiveException
public void deleteIssue(ApplicationUser user, Issue issue, EventDispatchOption eventDispatchOption, boolean sendMail) throws RemoveException
IssueManager
This will clean up all issue associations in JIRA and will de-index the issue.
This method should be used if you want to exert more control over what happens when JIRA deletes an issue. This
method will allow you to specify if an event is dispatched and if so which event is dispatched, see
EventDispatchOption
. This method also allows you to specify if email
notifications should be send to notify users of the deletion.
deleteIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to delete.eventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.RemoveException
- throw if something goes horribly wrong when deleting the issue.public void deleteIssue(ApplicationUser user, MutableIssue issue, EventDispatchOption eventDispatchOption, boolean sendMail) throws RemoveException
IssueManager
This method should be used if you want to exert more control over what happens when JIRA deletes an issue. This
method will allow you to specify if an event is dispatched and if so which event is dispatched, see
EventDispatchOption
. This method also allows you to specify if email
notifications should be send to notify users of the deletion.
deleteIssue
in interface IssueManager
user
- who is performing the operationissue
- the issue to delete.eventDispatchOption
- specifies if an event should be sent and if so which should be sent.sendMail
- if true mail notifications will be sent, otherwise mail notifications will be suppressed.RemoveException
- throw if something goes horribly wrong when deleting the issue.public void deleteIssueNoEvent(Issue issue) throws RemoveException
IssueManager
This is preferred in some bulk operations, but normally you would call #deleteIssue(com.atlassian.crowd.embedded.api.User, Issue, com.atlassian.jira.event.type.EventDispatchOption, boolean)
deleteIssueNoEvent
in interface IssueManager
issue
- issue to deleteRemoveException
- if the removal fails#deleteIssue(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue, com.atlassian.jira.event.type.EventDispatchOption, boolean)
public void deleteIssueNoEvent(MutableIssue issue) throws RemoveException
IssueManager
This is preferred in some bulk operations, but normally you would call #deleteIssue(com.atlassian.crowd.embedded.api.User, MutableIssue, com.atlassian.jira.event.type.EventDispatchOption, boolean)
deleteIssueNoEvent
in interface IssueManager
issue
- issue to deleteRemoveException
- if the removal fails#deleteIssue(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.MutableIssue, com.atlassian.jira.event.type.EventDispatchOption, boolean)
public List getProjectIssues(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getProjectIssues
in interface IssueManager
project
- the ProjectGenericValue
objectsorg.ofbiz.core.entity.GenericEntityException
- If there are errors in the persistence layer.public boolean isEditable(Issue issue)
IssueManager
true
if the issue can be edited. This is determined by looking at the workflow step the issue is in.isEditable
in interface IssueManager
issue
- the Issue.true
if the issue can be edited. This is determined by looking at the workflow step the issue is in.public void setEditable(boolean editable)
public boolean isEditable(Issue issue, ApplicationUser user)
IssueManager
true
if the issue can be edited by the current user. This is determined by looking at both the
user's permissions and the workflow step the issue is in.isEditable
in interface IssueManager
issue
- the issue you want to edituser
- the user who will be performing the edittrue
if the user has permission and the issue is in an editable workflow steppublic void setEditableAfterAction(boolean editableAfterAction)
public boolean isEditable(@Nonnull Issue issue, @Nonnull String nextStatusId)
IssueManager
true
if the issue can be edited after action. This is determined by looking at the workflow step the issue will be when action is completed.isEditable
in interface IssueManager
issue
- the Issue.nextStatusId
- the id of the status the issue will be in after transition
looking at the workflow status the issue will be in, after the action is completed.public Collection getIssueIdsForProject(Long projectId) throws org.ofbiz.core.entity.GenericEntityException
IssueManager
getIssueIdsForProject
in interface IssueManager
projectId
- Project ID.org.ofbiz.core.entity.GenericEntityException
- An exception in the ofbiz Entity Engine.public long getIssueCountForProject(Long projectId)
IssueManager
getIssueCountForProject
in interface IssueManager
projectId
- identifies the project which the issues are associated withpublic long getIssueCount()
IssueManager
getIssueCount
in interface IssueManager
public boolean atLeastOneIssueExists()
IssueManager
atLeastOneIssueExists
in interface IssueManager
public boolean hasUnassignedIssues()
IssueManager
hasUnassignedIssues
in interface IssueManager
public long getUnassignedIssueCount()
IssueManager
getUnassignedIssueCount
in interface IssueManager
public Issue findMovedIssue(String oldIssueKey)
IssueManager
findMovedIssue
in interface IssueManager
oldIssueKey
- the original key of an issue that has since been moved (moving between projects assigns a new
key to an issue)Issue
objectpublic void recordMovedIssueKey(Issue oldIssue)
IssueManager
recordMovedIssueKey
in interface IssueManager
oldIssue
- The issue with it's old issue key@Nonnull public Set<Pair<Long,String>> getProjectIssueTypePairsByKeys(@Nonnull Set<String> issueKeys)
IssueManager
getProjectIssueTypePairsByKeys
in interface IssueManager
issueKeys
- Set of issue keys@Nonnull public Set<Pair<Long,String>> getProjectIssueTypePairsByIds(@Nonnull Set<Long> issueIds)
IssueManager
getProjectIssueTypePairsByIds
in interface IssueManager
issueIds
- Set of issue IDs@Nonnull public Set<String> getKeysOfMissingIssues(@Nonnull Set<String> issueKeys)
IssueManager
getKeysOfMissingIssues
in interface IssueManager
issueKeys
- Set of issue keys@Nonnull public Set<Long> getIdsOfMissingIssues(@Nonnull Set<Long> issueIds)
IssueManager
getIdsOfMissingIssues
in interface IssueManager
issueIds
- Set of issue IDspublic List<Issue> getVotedIssuesOverrideSecurity(ApplicationUser user)
IssueManager
getVotedIssuesOverrideSecurity
in interface IssueManager
user
- The user.Issue
objects the user has voted on.public List<Issue> getVotedIssues(ApplicationUser user)
IssueManager
getVotedIssues
in interface IssueManager
user
- The user.Issue
objects the user has voted on.public List<ApplicationUser> getWatchers(Issue issue)
IssueManager
getWatchers
in interface IssueManager
issue
- the IssueUser
s.public List<ApplicationUser> getWatchersFor(Issue issue)
IssueManager
getWatchersFor
in interface IssueManager
issue
- the IssueUser
s.public List<Issue> getWatchedIssues(ApplicationUser user)
IssueManager
getWatchedIssues
in interface IssueManager
user
- the User.Issue
objectspublic List<Issue> getWatchedIssuesOverrideSecurity(ApplicationUser user)
IssueManager
getWatchedIssuesOverrideSecurity
in interface IssueManager
user
- the User.Issue
objectspublic void addIssue(org.ofbiz.core.entity.GenericValue issueGV)
public void addIssue(MutableIssue issue)
public void addVersion(org.ofbiz.core.entity.GenericValue version) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
public List execute(SearchRequest searchRequest, ApplicationUser searcher) throws SearchException
searchRequest
- object to be used to search forSearchException
public void refresh()
public void refresh(org.ofbiz.core.entity.GenericValue issue)
public long getCacheHitsCount()
public long getCacheMissCount()
public void resetCacheStats()
public long getCacheMaxSize()
public void setCacheMaxSize(long maxSize)
public long getCacheSize()
public void refreshParents(String associationName, org.ofbiz.core.entity.GenericValue child) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
Copyright © 2002-2019 Atlassian. All Rights Reserved.