Package com.atlassian.jira.scheme
Interface SchemeManager
- All Known Subinterfaces:
IssueSecuritySchemeManager
,NotificationSchemeManager
,PermissionSchemeManager
,WorkflowSchemeManager
- All Known Implementing Classes:
AbstractSchemeManager
,DefaultNotificationSchemeManager
,DefaultPermissionSchemeManager
,DefaultWorkflowSchemeManager
,EagerWorkflowSchemeManager
,IssueSecuritySchemeManagerImpl
,WorkflowBasedPermissionSchemeManager
public interface SchemeManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDefaultSchemeToProject
(Project project) Adds the default scheme to a particular projectvoid
addDefaultSchemeToProject
(org.ofbiz.core.entity.GenericValue project) Deprecated.void
addSchemeToProject
(Project project, Scheme scheme) Adds a scheme to a particular projectvoid
addSchemeToProject
(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue scheme) Deprecated.copyScheme
(Scheme scheme) Copys a scheme, giving the new scheme the same entities as the original oneorg.ofbiz.core.entity.GenericValue
copyScheme
(org.ofbiz.core.entity.GenericValue scheme) Deprecated.UsecopyScheme(Scheme)
instead.org.ofbiz.core.entity.GenericValue
Creates a default scheme, with an id of 0org.ofbiz.core.entity.GenericValue
createScheme
(String name, String description) Deprecated.UsecreateSchemeObject(String, String)
instead.createSchemeAndEntities
(Scheme scheme) org.ofbiz.core.entity.GenericValue
createSchemeEntity
(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity entity) createSchemeObject
(String name, String description) Creates a new schemevoid
deleteEntities
(Iterable<Long> ids) Deletes a collection of entities from the database.void
deleteEntity
(Long id) Deletes an entity with the given id from the database.void
deleteScheme
(Long id) Deletes a scheme from the databasegetAssociatedSchemes
(boolean withEntitiesComparable) Gets all schemes of this type in the database taht are associated with at least one project.org.ofbiz.core.entity.GenericValue
Deprecated.UsegetDefaultSchemeObject()
instead.Gets the default scheme.List<org.ofbiz.core.entity.GenericValue>
getEntities
(String type, String parameter) Get all entity records with a particular parameterList<org.ofbiz.core.entity.GenericValue>
getEntities
(org.ofbiz.core.entity.GenericValue scheme) Get all Scheme entity records for a particular schemeList<org.ofbiz.core.entity.GenericValue>
getEntities
(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) List<org.ofbiz.core.entity.GenericValue>
getEntities
(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId, String parameter) List<org.ofbiz.core.entity.GenericValue>
getEntities
(org.ofbiz.core.entity.GenericValue scheme, String entityTypeId) List<org.ofbiz.core.entity.GenericValue>
getEntities
(org.ofbiz.core.entity.GenericValue scheme, String type, Long entityTypeId) List<org.ofbiz.core.entity.GenericValue>
getEntitiesByIds
(List<Long> ids) Get all entity records for a list of idsorg.ofbiz.core.entity.GenericValue
Gets a scheme entity based on the id of the entityCollection<com.atlassian.crowd.embedded.api.Group>
Collection<com.atlassian.crowd.embedded.api.Group>
Deprecated.UsegetGroups(Long, com.atlassian.jira.project.Project)
instead.getProjects
(Scheme scheme) Gets all projects that are associated with that schemeorg.ofbiz.core.entity.GenericValue
Deprecated.UsegetSchemeObject(Long)
instead.org.ofbiz.core.entity.GenericValue
Deprecated.usegetSchemeObject(String)
instead.getSchemeFor
(Project project) Get the scheme of this type attached to the given project.getSchemeIdFor
(Project project) Get the scheme of this type attached to the given project.getSchemeObject
(Long id) Gets a scheme by id from the database.getSchemeObject
(String name) Gets a scheme by name from the database.Gets all scheme objects in the database.List<org.ofbiz.core.entity.GenericValue>
Deprecated.usegetSchemeObjects()
.List<org.ofbiz.core.entity.GenericValue>
getSchemes
(org.ofbiz.core.entity.GenericValue project) Deprecated.UsegetSchemeFor(com.atlassian.jira.project.Project)
instead.Will return all @link Scheme objects that are not currently associated with any projects.getUsers
(Long permissionId, PermissionContext ctx) Deprecated.boolean
removeEntities
(String type, String parameter) Removes all scheme entities with this parameter and typeboolean
removeEntities
(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) Deprecated.UsegetEntities(org.ofbiz.core.entity.GenericValue, Long)
anddeleteEntity(Long)
instead.void
removeSchemesFromProject
(Project project) Removes all schemes from a projectvoid
removeSchemesFromProject
(org.ofbiz.core.entity.GenericValue project) Deprecated.boolean
schemeExists
(String name) Determine if the given scheme name exists.void
swapParameterForEntitiesOfType
(String type, String parameter, String resultingParameter) Swaps all parameters of entities with the given type scheme to the given resulting parametervoid
updateScheme
(Scheme scheme) Updates any changes to the scheme object.void
updateScheme
(org.ofbiz.core.entity.GenericValue entity) Deprecated.UseupdateScheme(Scheme)
instead.
-
Field Details
-
PROJECT_ASSOCIATION
The one and only "association type".- See Also:
-
-
Method Details
-
getScheme
org.ofbiz.core.entity.GenericValue getScheme(Long id) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UsegetSchemeObject(Long)
instead. Since v5.0.Gets a scheme based on the Id of the scheme- Parameters:
id
- Id of the scheme- Returns:
- The scheme
- Throws:
org.ofbiz.core.entity.GenericEntityException
- DB Error
-
getSchemeObject
Gets a scheme by id from the database.- Parameters:
id
- the id of the scheme to get.- Returns:
- the Scheme
- Throws:
DataAccessException
- if there is trouble retrieving from the database.
-
getSchemes
List<org.ofbiz.core.entity.GenericValue> getSchemes() throws org.ofbiz.core.entity.GenericEntityExceptionDeprecated.usegetSchemeObjects()
. Since 2010.Gets all the Schemes (of the type defined by the subclass) from the database.- Returns:
- the schemes.
- Throws:
org.ofbiz.core.entity.GenericEntityException
- DB Error
-
getSchemeObjects
Gets all scheme objects in the database.- Returns:
- the schemes.
- Throws:
DataAccessException
- if the database is down or equivalent.
-
getAssociatedSchemes
Gets all schemes of this type in the database taht are associated with at least one project.- Parameters:
withEntitiesComparable
- if true then the scheme entites will be logically comparable (they will not include database specific information such as the pk id). Otherwise the object will be a full representation of the row stored in the database.- Returns:
- List of associated schemes
-
getScheme
org.ofbiz.core.entity.GenericValue getScheme(String name) throws org.ofbiz.core.entity.GenericEntityException Deprecated.usegetSchemeObject(String)
instead. Since 2010.Gets a scheme by name from the database.- Parameters:
name
- the name of the scheme to get.- Returns:
- the Scheme
- Throws:
org.ofbiz.core.entity.GenericEntityException
- DB error
-
getSchemeObject
Gets a scheme by name from the database.- Parameters:
name
- the name of the scheme to get.- Returns:
- the Scheme
- Throws:
DataAccessException
- if there is trouble retrieving from the database.
-
getSchemes
List<org.ofbiz.core.entity.GenericValue> getSchemes(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UsegetSchemeFor(com.atlassian.jira.project.Project)
instead. Since v5.0.Get all schemes of this type attached to the given project.- Parameters:
project
- The project that the schemes are attached to- Returns:
- List of schemes
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
getSchemeFor
Get the scheme of this type attached to the given project.- Parameters:
project
- The project- Returns:
- The scheme associated with this project.
- See Also:
-
getSchemeIdFor
Get the scheme of this type attached to the given project.- Parameters:
project
- The project- Returns:
- The ID of the scheme associated with this project.
- Since:
- 6.4
- See Also:
-
schemeExists
Determine if the given scheme name exists.- Parameters:
name
- The name of the scheme- Returns:
- true is the schem exists.
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
createScheme
@Deprecated org.ofbiz.core.entity.GenericValue createScheme(String name, String description) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UsecreateSchemeObject(String, String)
instead. Since v5.0.Creates a new scheme- Parameters:
name
- The name of the new schemedescription
- The description of the new scheme- Returns:
- The new scheme object
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
createSchemeObject
Creates a new scheme- Parameters:
name
- The name of the new schemedescription
- The description of the new scheme- Returns:
- The new scheme object
-
createSchemeAndEntities
- Throws:
DataAccessException
-
getEntity
org.ofbiz.core.entity.GenericValue getEntity(Long id) throws org.ofbiz.core.entity.GenericEntityException Gets a scheme entity based on the id of the entity- Parameters:
id
- The id of the entity- Returns:
- The scheme entity object
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException Get all Scheme entity records for a particular scheme- Parameters:
scheme
- The scheme that the entities belong to- Returns:
- List of (GenericValue) entities
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String entityTypeId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId, String parameter) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
updateScheme
void updateScheme(org.ofbiz.core.entity.GenericValue entity) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UseupdateScheme(Scheme)
instead. Since v5.0.Updates any changes to the given scheme- Parameters:
entity
- The modified scheme- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
updateScheme
Updates any changes to the scheme object. This does not include changes to the scheme entities.- Parameters:
scheme
- The modified scheme object
-
deleteScheme
Deletes a scheme from the database- Parameters:
id
- Id of the scheme to be deleted- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
addSchemeToProject
void addSchemeToProject(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UseaddSchemeToProject(com.atlassian.jira.project.Project, Scheme)
instead. Since v5.0.Adds a scheme to a particular project- Parameters:
project
- The project that the scheme is to be added toscheme
- The scheme to be added- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
addSchemeToProject
Adds a scheme to a particular project- Parameters:
project
- The project that the scheme is to be added toscheme
- The scheme to be added
-
removeSchemesFromProject
void removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UseremoveSchemesFromProject(com.atlassian.jira.project.Project)
instead. Since v4.4.Removes all schemes from a project- Parameters:
project
- The project that all schemes are to be deleted from- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
removeSchemesFromProject
Removes all schemes from a project- Parameters:
project
- The project that all schemes are to be deleted from
-
createSchemeEntity
org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity entity) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
deleteEntity
Deletes an entity with the given id from the database.- Parameters:
id
- The id of the entity to be deleted- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
deleteEntities
Deletes a collection of entities from the database.- Parameters:
ids
- a collection entity ids to be deleted.- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getProjects
Gets all projects that are associated with that scheme- Parameters:
scheme
- The scheme used to get all projects- Returns:
- List of
Project
's
-
createDefaultScheme
org.ofbiz.core.entity.GenericValue createDefaultScheme() throws org.ofbiz.core.entity.GenericEntityExceptionCreates a default scheme, with an id of 0- Returns:
- The new permission scheme object
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
getDefaultScheme
org.ofbiz.core.entity.GenericValue getDefaultScheme() throws org.ofbiz.core.entity.GenericEntityExceptionDeprecated.UsegetDefaultSchemeObject()
instead. Since v5.0.Gets the default scheme. This should have an id of 0This does not work for the Default Notification scheme as it does not have an id of 0.
- Returns:
- The default scheme
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
getDefaultSchemeObject
Scheme getDefaultSchemeObject()Gets the default scheme. This should have an id of 0This does not work for the Default Notification scheme as it does not have an id of 0.
- Returns:
- The default scheme
-
addDefaultSchemeToProject
void addDefaultSchemeToProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UseaddDefaultSchemeToProject(com.atlassian.jira.project.Project)
instead. Since v5.0.Adds the default scheme to a particular project- Parameters:
project
- The project that the scheme is to be added to- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
addDefaultSchemeToProject
Adds the default scheme to a particular project- Parameters:
project
- The project that the scheme is to be added to
-
copyScheme
org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException Deprecated.UsecopyScheme(Scheme)
instead. Since v5.0.Copys a scheme, giving the new scheme the same entities as the original one- Parameters:
scheme
- The permission scheme to be copied- Returns:
- The new permission scheme
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
copyScheme
Copys a scheme, giving the new scheme the same entities as the original one- Parameters:
scheme
- The permission scheme to be copied- Returns:
- The new permission scheme
-
removeEntities
boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) throws RemoveException Deprecated.UsegetEntities(org.ofbiz.core.entity.GenericValue, Long)
anddeleteEntity(Long)
instead. Since v5.0.Retrieves all the entites for this permission and then removes them.- Parameters:
scheme
- to remove entites from must NOT be nullentityTypeId
- to remove- Returns:
- True all the time (legacy)
- Throws:
RemoveException
- if the delete fails (DB error)
-
getEntities
List<org.ofbiz.core.entity.GenericValue> getEntities(String type, String parameter) throws org.ofbiz.core.entity.GenericEntityException Get all entity records with a particular parameter- Parameters:
type
- The type of entity you wish to retrieve, eg 'user', 'group', 'projectrole'parameter
- The parameter in the entity- Returns:
- List of (GenericValue) entities
- Throws:
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurs
-
removeEntities
Removes all scheme entities with this parameter and type- Parameters:
type
- the 'type' of entity you are deleting, eg 'group', 'user', 'projectrole'parameter
- must NOT be null- Returns:
- true always (legacy)
- Throws:
RemoveException
- if the delete fails (DB error)
-
swapParameterForEntitiesOfType
Swaps all parameters of entities with the given type scheme to the given resulting parameter- Parameters:
type
- the 'type' of entity you are swapping, eg 'group', 'user', 'projectrole'parameter
- must NOT be null- Throws:
RemoveException
- if the swap fails (DB error)
-
getGroups
Collection<com.atlassian.crowd.embedded.api.Group> getGroups(Long permissionId, org.ofbiz.core.entity.GenericValue project) Deprecated.UsegetGroups(Long, com.atlassian.jira.project.Project)
instead. Since v5.0. -
getGroups
-
getUsers
-
getUsers
-
getUsers
@Deprecated Collection<ApplicationUser> getUsers(Long permissionId, org.ofbiz.core.entity.GenericValue issueOrProject) Deprecated.UsegetUsers(Long, com.atlassian.jira.permission.PermissionContext)
instead. Since 2006. -
getUsers
-
getUnassociatedSchemes
Will return all @link Scheme objects that are not currently associated with any projects.- Returns:
- list of @link Scheme objects
- Throws:
DataAccessException
- if the database is down or equivalent.
-
getEntitiesByIds
Get all entity records for a list of ids- Parameters:
ids
- a collection of entity ids that should be retrieved- Returns:
- List of (GenericValue) entities - can be an empty list if no entities match the given ids
-
addDefaultSchemeToProject(com.atlassian.jira.project.Project)
instead.