com.atlassian.jira.config
Interface ConstantsManager

All Known Implementing Classes:
DefaultConstantsManager

@PublicApi
public interface ConstantsManager

Manager for issue types, statuses, priorities and resolutions. This manager is responsible for caching these constants as well as all the usual update, delete, add operations in the database.


Field Summary
static String ALL_ISSUE_TYPES
          Used to retrieve all IssueTypes.
static String ALL_STANDARD_ISSUE_TYPES
          Used to retrieve a standard IssueTypes.
static String ALL_SUB_TASK_ISSUE_TYPES
          Used to retrieve a subtask IssueTypes.
static String ISSUE_TYPE_CONSTANT_TYPE
          Used in the generic getConstantObject(String, String) method
static String PRIORITY_CONSTANT_TYPE
          Used in the generic getConstantObject(String, String) method
static String RESOLUTION_CONSTANT_TYPE
          Used in the generic getConstantObject(String, String) method
static String STATUS_CONSTANT_TYPE
          Used in the generic getConstantObject(String, String) method
 
Method Summary
 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
 org.ofbiz.core.entity.GenericValue createIssueType(String name, Long sequence, String style, String description, String iconurl)
          Deprecated. Use insertIssueType(String, Long, String, String, String) instead. Since v5.0.
 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 ALL_STANDARD_ISSUE_TYPES, ALL_SUB_TASK_ISSUE_TYPES and 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()
          Deprecated. Use getAllIssueTypeObjects() instead. Deprecated since v4.0
 org.ofbiz.core.entity.GenericValue getConstantByName(String constantType, String name)
          Deprecated. Use getIssueConstantByName(String, String). Since v4.3
 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.
 org.ofbiz.core.entity.GenericValue getDefaultPriority()
          Deprecated. Use getDefaultPriorityObject() instead. Since v4.0
 Priority getDefaultPriorityObject()
          Returns the default priority configured in JIRA.
 List<org.ofbiz.core.entity.GenericValue> getEditableSubTaskIssueTypes()
          Retrieves an editable 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.
 org.ofbiz.core.entity.GenericValue getIssueType(String id)
          Deprecated. Use getIssueTypeObject(String) instead. Since 5.0
 IssueType getIssueTypeObject(String id)
          Given an IssueType ID this method retrieves that IssueType.
 Collection<org.ofbiz.core.entity.GenericValue> getIssueTypes()
          Deprecated. Use getRegularIssueTypeObjects() instead.
 Collection<org.ofbiz.core.entity.GenericValue> getPriorities()
          Deprecated. since 1.99. Use getPriorityObjects() instead
 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.
 org.ofbiz.core.entity.GenericValue getResolution(String id)
          Deprecated. Use getResolutionObject(String) instead.
 Resolution getResolutionObject(String id)
          Given a resolution ID, this method retrieves that resolution.
 Collection<Resolution> getResolutionObjects()
          Retrieve all Resolutions in JIRA.
 Collection<org.ofbiz.core.entity.GenericValue> getResolutions()
          Deprecated. Use getResolutionObjects() instead.
 org.ofbiz.core.entity.GenericValue getStatus(String id)
          Deprecated. Use getStatusObject(java.lang.String) instead. Deprecated since v4.0
 Status getStatusByName(String name)
          Searches for a given status by name.
 Status getStatusByTranslatedName(String name)
          Searches for a given status by its translated name.
 Collection<org.ofbiz.core.entity.GenericValue> getStatuses()
          Deprecated. Use getStatusObjects() instead. Deprecated since v4.0
 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()
          Deprecated. Use getSubTaskIssueTypeObjects() instead. Deprecated since v4.0
 IssueType insertIssueType(String name, Long sequence, String style, String description, String iconurl)
          Creates a new IssueType.
 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, 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.
 

Field Detail

ALL_STANDARD_ISSUE_TYPES

static final String ALL_STANDARD_ISSUE_TYPES
Used to retrieve a standard IssueTypes.

See Also:
Constant Field Values

ALL_SUB_TASK_ISSUE_TYPES

static final String ALL_SUB_TASK_ISSUE_TYPES
Used to retrieve a subtask IssueTypes.

See Also:
Constant Field Values

ALL_ISSUE_TYPES

static final String ALL_ISSUE_TYPES
Used to retrieve all IssueTypes.

See Also:
Constant Field Values

PRIORITY_CONSTANT_TYPE

static final String PRIORITY_CONSTANT_TYPE
Used in the generic getConstantObject(String, String) method

See Also:
Constant Field Values

STATUS_CONSTANT_TYPE

static final String STATUS_CONSTANT_TYPE
Used in the generic getConstantObject(String, String) method

See Also:
Constant Field Values

RESOLUTION_CONSTANT_TYPE

static final String RESOLUTION_CONSTANT_TYPE
Used in the generic getConstantObject(String, String) method

See Also:
Constant Field Values

ISSUE_TYPE_CONSTANT_TYPE

static final String ISSUE_TYPE_CONSTANT_TYPE
Used in the generic getConstantObject(String, String) method

See Also:
Constant Field Values
Method Detail

getPriorities

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getPriorities()
Deprecated. since 1.99. Use getPriorityObjects() instead

Retrieve all Priorities in JIRA.

Returns:
A list of Priority GenericValues.

getPriorityObjects

Collection<Priority> getPriorityObjects()
Retrieve all Priorities in JIRA.

Returns:
A list of Prioritys.

getPriorityObject

Priority getPriorityObject(String id)
Given a priority ID, this method retrieves that priority.

Parameters:
id - The id of the priority
Returns:
A Priority object.

getPriorityName

String getPriorityName(String id)
Returns the priority Name for a given priority ID.

Parameters:
id - The id of a priority
Returns:
The name of the priority with the given ID, or an i18n'd String indicating that no priority is set (e.g. "None") if the ID is null.

getDefaultPriority

org.ofbiz.core.entity.GenericValue getDefaultPriority()
Deprecated. Use getDefaultPriorityObject() instead. Since v4.0

Returns the default priority configured in JIRA.

Returns:
The default priority GenericValue.

getDefaultPriorityObject

Priority getDefaultPriorityObject()
Returns the default priority configured in JIRA.

Returns:
The default priority.

refreshPriorities

void refreshPriorities()
Reloads all priorities from the DB.


getResolutions

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getResolutions()
Deprecated. Use getResolutionObjects() instead.

Retrieve all Resolutions in JIRA.

Returns:
A List of Resolution GenericValues.

getResolutionObjects

Collection<Resolution> getResolutionObjects()
Retrieve all Resolutions in JIRA.

Returns:
A List of Resolution objects.

getResolution

@Deprecated
org.ofbiz.core.entity.GenericValue getResolution(String id)
Deprecated. Use getResolutionObject(String) instead.

Given a resolution ID, this method retrieves that resolution.

Parameters:
id - The id of the resolution
Returns:
A resolution GenericValue

getResolutionObject

Resolution getResolutionObject(String id)
Given a resolution ID, this method retrieves that resolution.

Parameters:
id - The id of the resolution
Returns:
A Resolution object.

refreshResolutions

void refreshResolutions()
Reloads all resolutions from the DB.


getIssueType

@Deprecated
org.ofbiz.core.entity.GenericValue getIssueType(String id)
Deprecated. Use getIssueTypeObject(String) instead. Since 5.0

Given an IssueType ID this method retrieves that IssueType.

Parameters:
id - The ID of the IssueType.
Returns:
An IssueType GenericValue

getIssueTypeObject

IssueType getIssueTypeObject(String id)
Given an IssueType ID this method retrieves that IssueType.

Parameters:
id - The ID of the IssueType.
Returns:
An IssueType object

getIssueTypes

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getIssueTypes()
Deprecated. Use getRegularIssueTypeObjects() instead.

Retrieve regular (non-subtask) issue types.

Returns:
A collection of IssueType GenericValues

getRegularIssueTypeObjects

Collection<IssueType> getRegularIssueTypeObjects()
Retrieve regular (non-subtask) issue types.

Returns:
A collection of IssueTypes

getAllIssueTypeObjects

Collection<IssueType> getAllIssueTypeObjects()
Returns a list of IssueTypes.

Returns:
A Collection of IssueType objects.

getAllIssueTypes

@Deprecated
List<org.ofbiz.core.entity.GenericValue> getAllIssueTypes()
Deprecated. Use getAllIssueTypeObjects() instead. Deprecated since v4.0

Returns a list of IssueTypes.

Returns:
A list of GenericValue issueTypes.

getAllIssueTypeIds

List<String> getAllIssueTypeIds()
Returns all issueType Ids.

Returns:
A list of all the IssueType Ids.

getSubTaskIssueTypes

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getSubTaskIssueTypes()
Deprecated. Use getSubTaskIssueTypeObjects() instead. Deprecated since v4.0

Retrieves all the sub-task issue types. These will be non-modifiable. Use getEditableSubTaskIssueTypes() instead if you require an editable list.

Returns:
A Collection of sub-task GenericValues.

getSubTaskIssueTypeObjects

Collection<IssueType> getSubTaskIssueTypeObjects()
Retrieves all the sub-task issue types

Returns:
A Collection of all sub-task IssueTypes.

getEditableSubTaskIssueTypes

List<org.ofbiz.core.entity.GenericValue> getEditableSubTaskIssueTypes()
Retrieves an editable list of sub-task issues.

Returns:
A List of editable sub-task GenericValues

expandIssueTypeIds

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 ALL_STANDARD_ISSUE_TYPES, ALL_SUB_TASK_ISSUE_TYPES and ALL_ISSUE_TYPES.

Parameters:
issueTypeIds - A collection of the issuetype Ids to retrieve.
Returns:
A list of "actual" IssueType ID's expanded from the macro constants (or a new copy of the original list if it doesn't contain macros).

refreshIssueTypes

void refreshIssueTypes()
Reloads all IssueTypes from the DB.


createIssueType

org.ofbiz.core.entity.GenericValue createIssueType(String name,
                                                   Long sequence,
                                                   String style,
                                                   String description,
                                                   String iconurl)
                                                   throws CreateException
Deprecated. Use insertIssueType(String, Long, String, String, String) instead. Since v5.0.

Note this metod does not validate the input - i.e. It does not check for duplicate names etc. Use this method in conjunction with validateCreateIssueType(String, String, String, String, com.atlassian.jira.util.ErrorCollection, String)

Parameters:
name - Name of the new IssueType
sequence - 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.
Returns:
The newly created IssueType
Throws:
CreateException - If there is an error creating this Issue Type.

insertIssueType

IssueType insertIssueType(String name,
                          Long sequence,
                          String style,
                          String description,
                          String iconurl)
                          throws CreateException
Creates a new IssueType.

Note this method does not validate the input - i.e. It does not check for duplicate names etc. Use this method in conjunction with validateCreateIssueType(String, String, String, String, com.atlassian.jira.util.ErrorCollection, String)

Parameters:
name - Name of the new IssueType
sequence - 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.
Returns:
The newly created IssueType
Throws:
CreateException - If there is an error creating this Issue Type.

validateCreateIssueType

void validateCreateIssueType(String name,
                             String style,
                             String description,
                             String iconurl,
                             ErrorCollection errors,
                             String nameFieldName)
Validates creation of a new issuetype. In particular, this function checks that a name has been submitted, no other issueTypes with the same name exist, and that the icon URL exists.

Parameters:
name - Name of the new IssueType
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.
errors - A collection of errors used to pass back any problems.
nameFieldName - The field to which the errors should be added.

updateIssueType

void updateIssueType(String id,
                     String name,
                     Long sequence,
                     String style,
                     String description,
                     String iconurl)
                     throws DataAccessException
Updates an existing issueType. This will cause a refresh of all issue types (i.e. reload from the DB).

Parameters:
id - ID of the existing issuetype.
name - Name of the new IssueType
sequence - 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.
Throws:
DataAccessException - indicates an error in the Data Access Layer

removeIssueType

void removeIssueType(String id)
                     throws RemoveException
Removes an existing issueType. This will cause a refresh of all issue types (i.e. reload from the DB).

Parameters:
id - ID of an existing issueType
Throws:
RemoveException - if the issueType with id doesn't exist, or an error occured removing the issue.

storeIssueTypes

void storeIssueTypes(List<org.ofbiz.core.entity.GenericValue> issueTypes)
                     throws DataAccessException
Bulk operation to store a list of issueTypes.

Parameters:
issueTypes - A list of IssueType GenericValues
Throws:
DataAccessException - indicates an error in the Data Access Layer

getStatus

@Deprecated
org.ofbiz.core.entity.GenericValue getStatus(String id)
Deprecated. Use getStatusObject(java.lang.String) instead. Deprecated since v4.0

Returns a Status given an id.

Parameters:
id - The id of a status
Returns:
Returns a status GenericValue

getStatusObject

Status getStatusObject(String id)
Returns a Status given an id.

Parameters:
id - The id of a status
Returns:
Returns a Status object.

getStatuses

@Deprecated
Collection<org.ofbiz.core.entity.GenericValue> getStatuses()
Deprecated. Use getStatusObjects() instead. Deprecated since v4.0

Returns all statuses

Returns:
Returns a Collection of status GenericValues.

getStatusObjects

Collection<Status> getStatusObjects()
Returns all statuses

Returns:
Returns a Collection of Status objects

refreshStatuses

void refreshStatuses()
Reloads all statuses from DB.


getStatusByName

Status getStatusByName(String name)
Searches for a given status by name. This is not the most efficient implementation. If the name is not found, or the given name is null, then it returns null.

Parameters:
name - The name of the status.
Returns:
A Status object with the given name, or null if none found.

getStatusByTranslatedName

Status getStatusByTranslatedName(String name)
Searches for a given status by its translated name. If no matching translated name is found the true (untranslated) name will be tried. If the name is not found, or the given name is null, then it returns null.

Parameters:
name - The name of the status.
Returns:
A Status object with the given name, or null if none found.

getConstantObject

IssueConstant getConstantObject(String constantType,
                                String id)
Returns an IssueConstant object for the given type & id.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
id - The id of the constant.
Returns:
A IssueConstant object. Null if it doesn't exist.

getConstantObjects

Collection getConstantObjects(String constantType)
Returns all IssueConstant objects for the given type.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
Returns:
A collection of IssueConstant object.

convertToConstantObjects

List convertToConstantObjects(String constantType,
                              Collection ids)
Converts the list of ids to the objects of appropriate types

Parameters:
constantType - the constant type. Case insenstive
ids - list of constant ids or GenericValues
Returns:
List of IssueConstant subclasses. Null if constantType is null or the ids are empty

constantExists

boolean constantExists(String constantType,
                       String name)
Checks if a constant exists.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
name - The name of the constant.
Returns:
True if the constant exists. False otherwise

getConstantByName

org.ofbiz.core.entity.GenericValue getConstantByName(String constantType,
                                                     String name)
Deprecated. Use getIssueConstantByName(String, String). Since v4.3

Returns a constant by name.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
name - The Name of the constant.
Returns:
A constant GenericValue

getIssueConstantByName

IssueConstant getIssueConstantByName(String constantType,
                                     String name)
Returns a constant by name.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
name - The Name of the constant.
Returns:
The IssueConstant

getConstantByNameIgnoreCase

IssueConstant getConstantByNameIgnoreCase(String constantType,
                                          String name)
Returns a constant by name ignoring the case of the name passed in.

Parameters:
constantType - See PRIORITY_CONSTANT_TYPE, STATUS_CONSTANT_TYPE, RESOLUTION_CONSTANT_TYPE, ISSUE_TYPE_CONSTANT_TYPE
name - The Name of the constant, case-insensitive.
Returns:
An IssueConstant (or null if not found)

getIssueConstant

IssueConstant getIssueConstant(org.ofbiz.core.entity.GenericValue issueConstantGV)
Converts a constant GenericValue to an IssueConstant object.

Parameters:
issueConstantGV - the constant GenericValue.
Returns:
An IssueConstant object.

refresh

void refresh()
Sets all cached copies of constant to null. This will cause them to be re-loaded from the DB the next time they are accessed.



Copyright © 2002-2012 Atlassian. All Rights Reserved.