public class MockConstantsManager extends Object implements ConstantsManager
ConstantsManager.CONSTANT_TYPEALL_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<IssueConstant> |
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.
|
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<? extends IssueConstant> |
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.
|
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<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
|
Collection<IssueType> |
getSubTaskIssueTypeObjects()
Retrieves all the sub-task issue types
|
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<org.ofbiz.core.entity.GenericValue> 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIssueTypeObject, getPriorityObjects, getStatusObject, getStatusObjectspublic Status getStatus(String id)
ConstantsManagergetStatus in interface ConstantsManagerid - The id of a status@Nonnull public Collection<Status> getStatuses()
ConstantsManagergetStatuses in interface ConstantsManagerStatuss.public void refreshStatuses()
ConstantsManagerrefreshStatuses in interface ConstantsManager@Nullable public List<IssueConstant> convertToConstantObjects(String constantType, Collection<?> ids)
ConstantsManagerconvertToConstantObjects in interface ConstantsManagerconstantType - the constant type. Case insenstiveids - list of constant ids or GenericValuespublic boolean constantExists(String constantType, String name)
ConstantsManagerconstantExists in interface ConstantsManagerconstantType - See ConstantsManager.PRIORITY_CONSTANT_TYPE, ConstantsManager.STATUS_CONSTANT_TYPE, ConstantsManager.RESOLUTION_CONSTANT_TYPE, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPEname - 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 ConstantsManagername - 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 ConstantsManagername - 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)
ConstantsManagervalidateCreateIssueType in interface ConstantsManagername - 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)
ConstantsManagervalidateCreateIssueTypeWithAvatar in interface ConstantsManagername - 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)
ConstantsManagerupdateIssueType in interface ConstantsManagerid - 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)
ConstantsManagerupdateIssueType in interface ConstantsManagerid - 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
ConstantsManagerTHIS METHOD IS BROKEN AND SHOULD NEVER BE USED SINCE v5.0.
removeIssueType in interface ConstantsManagerid - 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)
ConstantsManagergetConstantByNameIgnoreCase in interface ConstantsManagerconstantType - See ConstantsManager.PRIORITY_CONSTANT_TYPE, ConstantsManager.STATUS_CONSTANT_TYPE, ConstantsManager.RESOLUTION_CONSTANT_TYPE, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPEname - The Name of the constant, case-insensitive.public IssueConstant getIssueConstantByName(String constantType, String name)
ConstantsManagergetIssueConstantByName in interface ConstantsManagerconstantType - See ConstantsManager.PRIORITY_CONSTANT_TYPE, ConstantsManager.STATUS_CONSTANT_TYPE, ConstantsManager.RESOLUTION_CONSTANT_TYPE, ConstantsManager.ISSUE_TYPE_CONSTANT_TYPEname - The Name of the constant.public List<IssueType> getEditableSubTaskIssueTypes()
ConstantsManagergetEditableSubTaskIssueTypes in interface ConstantsManagerpublic List<String> getAllIssueTypeIds()
ConstantsManagergetAllIssueTypeIds in interface ConstantsManagerpublic IssueConstant getIssueConstant(org.ofbiz.core.entity.GenericValue issueConstantGV)
ConstantsManagerGenericValue to an IssueConstant object.getIssueConstant in interface ConstantsManagerissueConstantGV - the constant GenericValue.IssueConstant object.public void storeIssueTypes(List<org.ofbiz.core.entity.GenericValue> issueTypes)
ConstantsManagerstoreIssueTypes in interface ConstantsManagerissueTypes - A list of IssueType GenericValuespublic void refresh()
ConstantsManagerrefresh in interface ConstantsManagerpublic com.atlassian.fugue.Option<Pair<String,ErrorCollection.Reason>> validateName(String name, com.atlassian.fugue.Option<IssueType> issueType)
ConstantsManagervalidateName in interface ConstantsManagerpublic void invalidateAll()
invalidateAll in interface ConstantsManagerpublic void invalidate(IssueConstant issueConstant)
ConstantsManagerinvalidate in interface ConstantsManagerpublic List<String> expandIssueTypeIds(Collection<String> issueTypeIds)
ConstantsManagerConstantsManager.ALL_STANDARD_ISSUE_TYPES, ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES and
ConstantsManager.ALL_ISSUE_TYPES.expandIssueTypeIds in interface ConstantsManagerissueTypeIds - A collection of the issuetype Ids to retrieve.@Nonnull public Collection<Priority> getPriorities()
ConstantsManagergetPriorities in interface ConstantsManagerPrioritys.public String getPriorityName(String id)
ConstantsManagergetPriorityName in interface ConstantsManagerid - The id of a prioritypublic Priority getPriorityObject(String id)
ConstantsManagergetPriorityObject in interface ConstantsManagerid - The id of the priorityPriority object.public Priority getDefaultPriority()
ConstantsManagergetDefaultPriority in interface ConstantsManagerpublic Priority getDefaultPriorityObject()
ConstantsManagergetDefaultPriorityObject in interface ConstantsManagerpublic void refreshPriorities()
ConstantsManagerrefreshPriorities in interface ConstantsManagerpublic Collection<Resolution> getResolutions()
ConstantsManagergetResolutions in interface ConstantsManagerResolutions.public Collection<Resolution> getResolutionObjects()
ConstantsManagergetResolutionObjects in interface ConstantsManagerResolution objects.public Resolution getResolution(String id)
ConstantsManagergetResolution in interface ConstantsManagerid - The id of the resolutionpublic Resolution getResolutionObject(String id)
ConstantsManagergetResolutionObject in interface ConstantsManagerid - The id of the resolutionResolution object.public void refreshResolutions()
ConstantsManagerrefreshResolutions in interface ConstantsManagerpublic IssueType getIssueType(String id)
ConstantsManagergetIssueType in interface ConstantsManagerid - The ID of the IssueType.public void refreshIssueTypes()
ConstantsManagerrefreshIssueTypes in interface ConstantsManagerpublic IssueConstant getConstantObject(String constantType, String id)
ConstantsManagerIssueConstant object for the given type & id.getConstantObject in interface ConstantsManagerconstantType - See ConstantsManager.CONSTANT_TYPEid - The id of the constant.IssueConstant object. Null if it doesn't exist.@Nonnull public Collection<? extends IssueConstant> getConstantObjects(String constantType)
ConstantsManagerIssueConstant objects for the given type.getConstantObjects in interface ConstantsManagerconstantType - See ConstantsManager.CONSTANT_TYPEIssueConstant object; will be null if and only if constantType
is invalidpublic 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()
ConstantsManagergetAllIssueTypeObjects in interface ConstantsManagerIssueType objects.public Collection<IssueType> getRegularIssueTypeObjects()
ConstantsManagergetRegularIssueTypeObjects in interface ConstantsManagerIssueTypes@Nonnull public Collection<IssueType> getSubTaskIssueTypeObjects()
ConstantsManagergetSubTaskIssueTypeObjects in interface ConstantsManagerIssueTypes.public Status getStatusByName(String name)
ConstantsManagergetStatusByName in interface ConstantsManagername - The name of the status.Status object with the given name, or null if none found.public Status getStatusByNameIgnoreCase(String name)
ConstantsManagergetStatusByNameIgnoreCase in interface ConstantsManagername - The name of the status.Status object with the given name, or null if none found.public Status getStatusByTranslatedName(String name)
ConstantsManagergetStatusByTranslatedName in interface ConstantsManagername - 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)
ConstantsManagergetConstantsByIds in interface ConstantsManagerconstantType - Type of constantids - list of constant idspublic void recalculateIssueTypeSequencesAndStore(List<IssueType> issueTypes)
ConstantsManagerrecalculateIssueTypeSequencesAndStore in interface ConstantsManagerpublic void recalculatePrioritySequencesAndStore(List<Priority> priorities)
ConstantsManagerrecalculatePrioritySequencesAndStore in interface ConstantsManagerpublic void recalculateStatusSequencesAndStore(List<Status> statuses)
ConstantsManagerrecalculateStatusSequencesAndStore in interface ConstantsManagerpublic void recalculateResolutionSequencesAndStore(List<Resolution> resolutions)
ConstantsManagerrecalculateResolutionSequencesAndStore in interface ConstantsManagerCopyright © 2002-2017 Atlassian. All Rights Reserved.