public class MockConstantsManager extends Object implements ConstantsManager
ConstantsManager.CONSTANT_TYPE
ALL_ISSUE_TYPES, ALL_STANDARD_ISSUE_TYPES, ALL_SUB_TASK_ISSUE_TYPES, ISSUE_TYPE_CONSTANT_TYPE, PRIORITY_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, STATUS_CONSTANT_TYPE
Constructor and Description |
---|
MockConstantsManager() |
Modifier and Type | Method and Description |
---|---|
void |
addIssueType(org.ofbiz.core.entity.GenericValue type) |
void |
addIssueType(IssueType type) |
void |
addStatus(org.ofbiz.core.entity.GenericValue status) |
boolean |
constantExists(String constantType,
String name)
Checks if a constant exists.
|
List |
convertToConstantObjects(String constantType,
Collection ids)
Converts the list of ids to the objects of appropriate types
|
List<String> |
expandIssueTypeIds(Collection<String> issueTypeIds)
Converts the 'special' ids of issue types to a list of issue type ids
For example, converts a special id to a list of all sub-task issue types
Also see
ConstantsManager.ALL_STANDARD_ISSUE_TYPES , ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES and
ConstantsManager.ALL_ISSUE_TYPES . |
List<String> |
getAllIssueTypeIds()
Returns all issueType Ids.
|
Collection<IssueType> |
getAllIssueTypeObjects()
Returns a list of IssueTypes.
|
List<org.ofbiz.core.entity.GenericValue> |
getAllIssueTypes() |
IssueConstant |
getConstantByNameIgnoreCase(String constantType,
String name)
Returns a constant by name ignoring the case of the name passed in.
|
IssueConstant |
getConstantObject(String constantType,
String id)
Returns an
IssueConstant object for the given type & id. |
Collection |
getConstantObjects(String constantType)
Returns all
IssueConstant objects for the given type. |
List<IssueConstant> |
getConstantsByIds(ConstantsManager.CONSTANT_TYPE constantType,
Collection<String> ids)
Converts the list of ids to the objects of appropriate types
|
Priority |
getDefaultPriority()
Returns the default priority configured in JIRA.
|
Priority |
getDefaultPriorityObject()
Returns the default priority configured in JIRA.
|
List<IssueType> |
getEditableSubTaskIssueTypes()
Retrieves an mutable list of sub-task issues.
|
IssueConstant |
getIssueConstant(org.ofbiz.core.entity.GenericValue issueConstantGV)
Converts a constant
GenericValue to an IssueConstant object. |
IssueConstant |
getIssueConstantByName(String constantType,
String name)
Returns a constant by name.
|
IssueType |
getIssueType(String id)
Given an IssueType ID this method retrieves that IssueType.
|
IssueType |
getIssueTypeObject(String id)
Given an IssueType ID this method retrieves that IssueType.
|
Collection<Priority> |
getPriorities()
Retrieve all Priorities in JIRA.
|
String |
getPriorityName(String id)
Returns the priority Name for a given priority ID.
|
Priority |
getPriorityObject(String id)
Given a priority ID, this method retrieves that priority.
|
Collection<Priority> |
getPriorityObjects()
Retrieve all Priorities in JIRA.
|
Collection<IssueType> |
getRegularIssueTypeObjects()
Retrieve regular (non-subtask) issue types.
|
Resolution |
getResolution(String id)
Given a resolution ID, this method retrieves that resolution.
|
Resolution |
getResolutionObject(String id)
Given a resolution ID, this method retrieves that resolution.
|
Collection<Resolution> |
getResolutionObjects()
Retrieve all Resolutions in JIRA.
|
Collection<Resolution> |
getResolutions()
Retrieve all Resolutions in JIRA.
|
Status |
getStatus(String id)
Returns a Status given an id.
|
Status |
getStatusByName(String name)
Searches for a given status by name.
|
Status |
getStatusByNameIgnoreCase(String name)
Searches for a given status by name ignoring case.
|
Status |
getStatusByTranslatedName(String name)
Searches for a given status by its translated name.
|
Collection<Status> |
getStatuses()
Returns all statuses
|
Status |
getStatusObject(String id)
Returns a Status given an id.
|
Collection<Status> |
getStatusObjects()
Returns all statuses
|
Collection<IssueType> |
getSubTaskIssueTypeObjects()
Retrieves all the sub-task issue types
|
Collection<org.ofbiz.core.entity.GenericValue> |
getSubTaskIssueTypes() |
IssueType |
insertIssueType(String name,
Long sequence,
String style,
String description,
Long avatarId)
Creates a new IssueType.
|
IssueType |
insertIssueType(String name,
Long sequence,
String style,
String description,
String iconurl)
Creates a new IssueType.
|
void |
invalidate(IssueConstant issueConstant)
Clear the cache for this Issue Constant.
|
void |
invalidateAll() |
void |
recalculateIssueTypeSequencesAndStore(List<IssueType> issueTypes)
Resequences the supplied issuetypes into sequential order.
|
void |
recalculatePrioritySequencesAndStore(List<Priority> priorities)
Resequences the supplied priorities into sequential order.
|
void |
recalculateResolutionSequencesAndStore(List<Resolution> resolutions)
Resequences the supplied resolutions into sequential order.
|
void |
recalculateStatusSequencesAndStore(List<Status> statuses)
Resequences the supplied statuses into sequential order.
|
void |
refresh()
Sets all cached copies of constant to null.
|
void |
refreshIssueTypes()
Reloads all IssueTypes from the DB.
|
void |
refreshPriorities()
Reloads all priorities from the DB.
|
void |
refreshResolutions()
Reloads all resolutions from the DB.
|
void |
refreshStatuses()
Reloads all statuses from DB.
|
void |
removeIssueType(String id)
Removes an existing issueType.
|
void |
storeIssueTypes(List issueTypes)
Bulk operation to store a list of issueTypes.
|
void |
updateIssueType(String id,
String name,
Long sequence,
String style,
String description,
Long avatarId)
Updates an existing issueType.
|
void |
updateIssueType(String id,
String name,
Long sequence,
String style,
String description,
String iconurl)
Updates an existing issueType.
|
void |
validateCreateIssueType(String name,
String style,
String description,
String iconurl,
ErrorCollection errors,
String nameFieldName)
Validates creation of a new issuetype.
|
void |
validateCreateIssueTypeWithAvatar(String name,
String style,
String description,
String avatarId,
ErrorCollection errors,
String nameFieldName)
Validates creation of a new issuetype.
|
com.atlassian.fugue.Option<Pair<String,ErrorCollection.Reason>> |
validateName(String name,
com.atlassian.fugue.Option<IssueType> issueType)
Validates the name of issue type.
|
public Status getStatus(String id)
ConstantsManager
getStatus
in interface ConstantsManager
id
- The id of a statuspublic Status getStatusObject(String id)
ConstantsManager
getStatusObject
in interface ConstantsManager
id
- The id of a statusStatus
object.public Collection<Status> getStatuses()
ConstantsManager
getStatuses
in interface ConstantsManager
Status
s.public Collection<Status> getStatusObjects()
ConstantsManager
getStatusObjects
in interface ConstantsManager
Status
objectspublic void refreshStatuses()
ConstantsManager
refreshStatuses
in interface ConstantsManager
public List convertToConstantObjects(String constantType, Collection ids)
ConstantsManager
convertToConstantObjects
in interface ConstantsManager
constantType
- the constant type. Case insenstiveids
- list of constant ids or GenericValuespublic boolean constantExists(String constantType, String name)
ConstantsManager
constantExists
in interface ConstantsManager
constantType
- See ConstantsManager.PRIORITY_CONSTANT_TYPE
, ConstantsManager.STATUS_CONSTANT_TYPE
, ConstantsManager.RESOLUTION_CONSTANT_TYPE
, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPE
name
- The name of the constant.public IssueType insertIssueType(String name, Long sequence, String style, String description, String iconurl)
ConstantsManager
Note this method does not validate the input - i.e. It does not check for duplicate names etc. Use
this method in conjunction with ConstantsManager.validateCreateIssueType(String, String, String, String, com.atlassian.jira.util.ErrorCollection, String)
insertIssueType
in interface ConstantsManager
name
- Name of the new IssueTypesequence
- Sequence number used for ordering the issuetypes in the UI.style
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.iconurl
- A URL to an icon to be used for the new issueType.public IssueType insertIssueType(String name, Long sequence, String style, String description, Long avatarId) throws CreateException
ConstantsManager
Note this method does not validate the input - i.e. It does not check for duplicate names etc. Use
this method in conjunction with ConstantsManager.validateCreateIssueType(String, String, String, String, com.atlassian.jira.util.ErrorCollection, String)
insertIssueType
in interface ConstantsManager
name
- Name of the new IssueTypesequence
- Sequence number used for ordering the issuetypes in the UI.style
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.avatarId
- Avatar id,CreateException
- If there is an error creating this Issue Type.public void validateCreateIssueType(String name, String style, String description, String iconurl, ErrorCollection errors, String nameFieldName)
ConstantsManager
validateCreateIssueType
in interface ConstantsManager
name
- Name of the new IssueTypestyle
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.iconurl
- A URL to an icon to be used for the new issueType.errors
- A collection of errors used to pass back any problems.nameFieldName
- The field to which the errors should be added.public void validateCreateIssueTypeWithAvatar(String name, String style, String description, String avatarId, ErrorCollection errors, String nameFieldName)
ConstantsManager
validateCreateIssueTypeWithAvatar
in interface ConstantsManager
name
- Name of the new IssueTypestyle
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.avatarId
- An avatar id.errors
- A collection of errors used to pass back any problems.nameFieldName
- The field to which the errors should be added.public void updateIssueType(String id, String name, Long sequence, String style, String description, String iconurl)
ConstantsManager
updateIssueType
in interface ConstantsManager
id
- ID of the existing issuetype.name
- Name of the new IssueTypesequence
- Sequence number used for ordering the issuetypes in the UI.style
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.iconurl
- A URL to an icon to be used for the new issueType.public void updateIssueType(String id, String name, Long sequence, String style, String description, Long avatarId)
ConstantsManager
updateIssueType
in interface ConstantsManager
id
- ID of the existing issuetype.name
- Name of the new IssueTypesequence
- Sequence number used for ordering the issuetypes in the UI.style
- Used to record the type of issue, such as SUBTASK. Null for regular issues.description
- A short description of the new issue type.avatarId
- avatarid of new issueType.public void removeIssueType(String id) throws RemoveException
ConstantsManager
removeIssueType
in interface ConstantsManager
id
- ID of an existing issueTypeRemoveException
- if the issueType with id doesn't exist, or an error occurred removing the issue.public IssueConstant getConstantByNameIgnoreCase(String constantType, String name)
ConstantsManager
getConstantByNameIgnoreCase
in interface ConstantsManager
constantType
- See ConstantsManager.PRIORITY_CONSTANT_TYPE
, ConstantsManager.STATUS_CONSTANT_TYPE
, ConstantsManager.RESOLUTION_CONSTANT_TYPE
, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPE
name
- The Name of the constant, case-insensitive.public IssueConstant getIssueConstantByName(String constantType, String name)
ConstantsManager
getIssueConstantByName
in interface ConstantsManager
constantType
- See ConstantsManager.PRIORITY_CONSTANT_TYPE
, ConstantsManager.STATUS_CONSTANT_TYPE
, ConstantsManager.RESOLUTION_CONSTANT_TYPE
, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPE
name
- The Name of the constant.public Collection<org.ofbiz.core.entity.GenericValue> getSubTaskIssueTypes()
public List<IssueType> getEditableSubTaskIssueTypes()
ConstantsManager
getEditableSubTaskIssueTypes
in interface ConstantsManager
public List<org.ofbiz.core.entity.GenericValue> getAllIssueTypes()
public List<String> getAllIssueTypeIds()
ConstantsManager
getAllIssueTypeIds
in interface ConstantsManager
public IssueConstant getIssueConstant(org.ofbiz.core.entity.GenericValue issueConstantGV)
ConstantsManager
GenericValue
to an IssueConstant
object.getIssueConstant
in interface ConstantsManager
issueConstantGV
- the constant GenericValue
.IssueConstant
object.public void storeIssueTypes(List issueTypes)
ConstantsManager
storeIssueTypes
in interface ConstantsManager
issueTypes
- A list of IssueType GenericValue
spublic void refresh()
ConstantsManager
refresh
in interface ConstantsManager
public com.atlassian.fugue.Option<Pair<String,ErrorCollection.Reason>> validateName(String name, com.atlassian.fugue.Option<IssueType> issueType)
ConstantsManager
validateName
in interface ConstantsManager
public void invalidateAll()
invalidateAll
in interface ConstantsManager
public void invalidate(IssueConstant issueConstant)
ConstantsManager
invalidate
in interface ConstantsManager
public List<String> expandIssueTypeIds(Collection<String> issueTypeIds)
ConstantsManager
ConstantsManager.ALL_STANDARD_ISSUE_TYPES
, ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES
and
ConstantsManager.ALL_ISSUE_TYPES
.expandIssueTypeIds
in interface ConstantsManager
issueTypeIds
- A collection of the issuetype Ids to retrieve.public Collection<Priority> getPriorities()
ConstantsManager
getPriorities
in interface ConstantsManager
Priority
s.public Collection<Priority> getPriorityObjects()
ConstantsManager
getPriorityObjects
in interface ConstantsManager
Priority
s.public String getPriorityName(String id)
ConstantsManager
getPriorityName
in interface ConstantsManager
id
- The id of a prioritypublic Priority getPriorityObject(String id)
ConstantsManager
getPriorityObject
in interface ConstantsManager
id
- The id of the priorityPriority
object.public Priority getDefaultPriority()
ConstantsManager
getDefaultPriority
in interface ConstantsManager
public Priority getDefaultPriorityObject()
ConstantsManager
getDefaultPriorityObject
in interface ConstantsManager
public void refreshPriorities()
ConstantsManager
refreshPriorities
in interface ConstantsManager
public Collection<Resolution> getResolutions()
ConstantsManager
getResolutions
in interface ConstantsManager
Resolution
s.public Collection<Resolution> getResolutionObjects()
ConstantsManager
getResolutionObjects
in interface ConstantsManager
Resolution
objects.public Resolution getResolution(String id)
ConstantsManager
getResolution
in interface ConstantsManager
id
- The id of the resolutionpublic Resolution getResolutionObject(String id)
ConstantsManager
getResolutionObject
in interface ConstantsManager
id
- The id of the resolutionResolution
object.public void refreshResolutions()
ConstantsManager
refreshResolutions
in interface ConstantsManager
public IssueType getIssueType(String id)
ConstantsManager
getIssueType
in interface ConstantsManager
id
- The ID of the IssueType.public IssueType getIssueTypeObject(String id)
ConstantsManager
getIssueTypeObject
in interface ConstantsManager
id
- The ID of the IssueType.IssueType
objectpublic void refreshIssueTypes()
ConstantsManager
refreshIssueTypes
in interface ConstantsManager
public IssueConstant getConstantObject(String constantType, String id)
ConstantsManager
IssueConstant
object for the given type & id.getConstantObject
in interface ConstantsManager
constantType
- See ConstantsManager.PRIORITY_CONSTANT_TYPE
, ConstantsManager.STATUS_CONSTANT_TYPE
, ConstantsManager.RESOLUTION_CONSTANT_TYPE
, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPE
id
- The id of the constant.IssueConstant
object. Null if it doesn't exist.public Collection getConstantObjects(String constantType)
ConstantsManager
IssueConstant
objects for the given type.getConstantObjects
in interface ConstantsManager
constantType
- See ConstantsManager.PRIORITY_CONSTANT_TYPE
, ConstantsManager.STATUS_CONSTANT_TYPE
, ConstantsManager.RESOLUTION_CONSTANT_TYPE
, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPE
IssueConstant
object.public void addIssueType(org.ofbiz.core.entity.GenericValue type)
public void addIssueType(IssueType type)
public void addStatus(org.ofbiz.core.entity.GenericValue status)
public Collection<IssueType> getAllIssueTypeObjects()
ConstantsManager
getAllIssueTypeObjects
in interface ConstantsManager
IssueType
objects.public Collection<IssueType> getRegularIssueTypeObjects()
ConstantsManager
getRegularIssueTypeObjects
in interface ConstantsManager
IssueType
spublic Collection<IssueType> getSubTaskIssueTypeObjects()
ConstantsManager
getSubTaskIssueTypeObjects
in interface ConstantsManager
IssueType
s.public Status getStatusByName(String name)
ConstantsManager
getStatusByName
in interface ConstantsManager
name
- The name of the status.Status
object with the given name, or null
if none found.public Status getStatusByNameIgnoreCase(String name)
ConstantsManager
getStatusByNameIgnoreCase
in interface ConstantsManager
name
- The name of the status.Status
object with the given name, or null
if none found.public Status getStatusByTranslatedName(String name)
ConstantsManager
getStatusByTranslatedName
in interface ConstantsManager
name
- The name of the status.Status
object with the given name, or null
if none found.@Nonnull public List<IssueConstant> getConstantsByIds(@Nonnull ConstantsManager.CONSTANT_TYPE constantType, @Nonnull Collection<String> ids)
ConstantsManager
getConstantsByIds
in interface ConstantsManager
constantType
- Type of constantids
- list of constant idspublic void recalculateIssueTypeSequencesAndStore(List<IssueType> issueTypes)
ConstantsManager
recalculateIssueTypeSequencesAndStore
in interface ConstantsManager
public void recalculatePrioritySequencesAndStore(List<Priority> priorities)
ConstantsManager
recalculatePrioritySequencesAndStore
in interface ConstantsManager
public void recalculateStatusSequencesAndStore(List<Status> statuses)
ConstantsManager
recalculateStatusSequencesAndStore
in interface ConstantsManager
public void recalculateResolutionSequencesAndStore(List<Resolution> resolutions)
ConstantsManager
recalculateResolutionSequencesAndStore
in interface ConstantsManager
Copyright © 2002-2015 Atlassian. All Rights Reserved.