public interface

SchemeManager

com.atlassian.jira.scheme.SchemeManager
Known Indirect Subclasses

Summary

Constants
String PROJECT_ASSOCIATION The one and only "association type".
Public Methods
void addDefaultSchemeToProject(GenericValue project)
This method is deprecated. Use addDefaultSchemeToProject(com.atlassian.jira.project.Project) instead. Since v5.0.
void addDefaultSchemeToProject(Project project)
Adds the default scheme to a particular project
void addSchemeToProject(Project project, Scheme scheme)
Adds a scheme to a particular project
void addSchemeToProject(GenericValue project, GenericValue scheme)
This method is deprecated. Use addSchemeToProject(com.atlassian.jira.project.Project, Scheme) instead. Since v5.0.
GenericValue copyScheme(GenericValue scheme)
This method is deprecated. Use copyScheme(Scheme) instead. Since v5.0.
Scheme copyScheme(Scheme scheme)
Copys a scheme, giving the new scheme the same entities as the original one
GenericValue createDefaultScheme()
Creates a default scheme, with an id of 0
GenericValue createScheme(String name, String description)
This method is deprecated. Use createSchemeObject(String, String) instead. Since v5.0.
Scheme createSchemeAndEntities(Scheme scheme)
GenericValue createSchemeEntity(GenericValue scheme, SchemeEntity entity)
Scheme createSchemeObject(String name, String description)
Creates a new scheme
void deleteEntity(Long id)
Deletes an entity with the given id from the database.
void deleteScheme(Long id)
Deletes a scheme from the database
List<Scheme> getAssociatedSchemes(boolean withEntitiesComparable)
Gets all schemes of this type in the database taht are associated with at least one project.
GenericValue getDefaultScheme()
This method is deprecated. Use getDefaultSchemeObject() instead. Since v5.0.
Scheme getDefaultSchemeObject()
Gets the default scheme.
List<GenericValue> getEntities(GenericValue scheme, String type, Long entityTypeId)
List<GenericValue> getEntities(GenericValue scheme)
Get all Scheme entity records for a particular scheme
List<GenericValue> getEntities(GenericValue scheme, String entityTypeId)
List<GenericValue> getEntities(String type, String parameter)
Get all entity records with a particular parameter
List<GenericValue> getEntities(GenericValue scheme, Long entityTypeId, String parameter)
List<GenericValue> getEntities(GenericValue scheme, Long entityTypeId)
GenericValue getEntity(Long id)
Gets a scheme entity based on the id of the entity
Collection<Group> getGroups(Long permissionId, Project project)
Collection<Group> getGroups(Long permissionId, GenericValue project)
This method is deprecated. Use getGroups(Long, com.atlassian.jira.project.Project) instead. Since v5.0.
@Deprecated List<GenericValue> getProjects(GenericValue scheme)
This method is deprecated. Use getProjects(Scheme) instead. Since 2009.
List<Project> getProjects(Scheme scheme)
Gets all projects that are associated with that scheme
GenericValue getScheme(Long id)
This method is deprecated. Use getSchemeObject(Long) instead. Since v5.0.
GenericValue getScheme(String name)
This method is deprecated. use getSchemeObject(String) instead. Since 2010.
Scheme getSchemeFor(Project project)
Get the scheme of this type attached to the given project.
Scheme getSchemeObject(String name)
Gets a scheme by name from the database.
Scheme getSchemeObject(Long id)
Gets a scheme by id from the database.
List<Scheme> getSchemeObjects()
Gets all scheme objects in the database.
List<GenericValue> getSchemes(GenericValue project)
This method is deprecated. Use getSchemeFor(com.atlassian.jira.project.Project) instead. Since v5.0.
List<GenericValue> getSchemes()
This method is deprecated. use getSchemeObjects(). Since 2010.
List<Scheme> getUnassociatedSchemes()
Will return all @link Scheme objects that are not currently associated with any projects.
Collection<User> getUsers(Long permissionId, Issue issue)
@Deprecated Collection<User> getUsers(Long permissionId, GenericValue issueOrProject)
This method is deprecated. Use getUsers(Long, com.atlassian.jira.permission.PermissionContext) instead. Since 2006.
Collection<User> getUsers(Long permissionId, Project project)
Collection<User> getUsers(Long permissionId, PermissionContext ctx)
boolean hasSchemeAuthority(Long entityType, GenericValue entity, User user, boolean issueCreation)
Checks the given user's permission of the given permission type for the given entity.
boolean hasSchemeAuthority(Long entityType, GenericValue entity)
Checks anonymous permission of the given permission type for the given entity.
boolean removeEntities(GenericValue scheme, Long entityTypeId)
This method is deprecated. Use getEntities(org.ofbiz.core.entity.GenericValue, Long) and deleteEntity(Long) instead. Since v5.0.
boolean removeEntities(String type, String parameter)
Removes all scheme entities with this parameter and type
void removeSchemesFromProject(Project project)
Removes all schemes from a project
void removeSchemesFromProject(GenericValue project)
This method is deprecated. Use removeSchemesFromProject(com.atlassian.jira.project.Project) instead. Since v4.4.
boolean schemeExists(String name)
Determine if the given scheme name exists.
void updateScheme(Scheme scheme)
Updates any changes to the scheme object.
void updateScheme(GenericValue entity)
This method is deprecated. Use updateScheme(Scheme) instead. Since v5.0.

Constants

public static final String PROJECT_ASSOCIATION

The one and only "association type".

Constant Value: "ProjectScheme"

Public Methods

public void addDefaultSchemeToProject (GenericValue project)

This method is deprecated.
Use addDefaultSchemeToProject(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
GenericEntityException If a DB error occurs

public void addDefaultSchemeToProject (Project project)

Adds the default scheme to a particular project

Parameters
project The project that the scheme is to be added to

public void addSchemeToProject (Project project, Scheme scheme)

Adds a scheme to a particular project

Parameters
project The project that the scheme is to be added to
scheme The scheme to be added

public void addSchemeToProject (GenericValue project, GenericValue scheme)

This method is deprecated.
Use addSchemeToProject(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 to
scheme The scheme to be added
Throws
GenericEntityException If a DB error occurs

public GenericValue copyScheme (GenericValue scheme)

This method is deprecated.
Use copyScheme(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
GenericEntityException If a DB error occurs

public Scheme copyScheme (Scheme scheme)

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

public GenericValue createDefaultScheme ()

Creates a default scheme, with an id of 0

Returns
  • The new permission scheme object
Throws
GenericEntityException If a DB error occurs

public GenericValue createScheme (String name, String description)

This method is deprecated.
Use createSchemeObject(String, String) instead. Since v5.0.

Creates a new scheme

Parameters
name The name of the new scheme
description The description of the new scheme
Returns
  • The new scheme object
Throws
GenericEntityException If a DB error occurs

public Scheme createSchemeAndEntities (Scheme scheme)

public GenericValue createSchemeEntity (GenericValue scheme, SchemeEntity entity)

Throws
GenericEntityException

public Scheme createSchemeObject (String name, String description)

Creates a new scheme

Parameters
name The name of the new scheme
description The description of the new scheme
Returns
  • The new scheme object

public void deleteEntity (Long id)

Deletes an entity with the given id from the database.

Parameters
id The id of the entity to be deleted
Throws
GenericEntityException If a DB error occurs

public void deleteScheme (Long id)

Deletes a scheme from the database

Parameters
id Id of the scheme to be deleted
Throws
GenericEntityException If a DB error occurs

public List<Scheme> getAssociatedSchemes (boolean withEntitiesComparable)

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

public GenericValue getDefaultScheme ()

This method is deprecated.
Use getDefaultSchemeObject() instead. Since v5.0.

Gets the default scheme. This should have an id of 0 This does not work for the Default Notification scheme as it does not have an id of 0.

Returns
  • The default scheme
Throws
GenericEntityException If a DB error occurs

public Scheme getDefaultSchemeObject ()

Gets the default scheme. This should have an id of 0 This does not work for the Default Notification scheme as it does not have an id of 0.

Returns
  • The default scheme

public List<GenericValue> getEntities (GenericValue scheme, String type, Long entityTypeId)

Throws
GenericEntityException

public List<GenericValue> getEntities (GenericValue scheme)

Get all Scheme entity records for a particular scheme

Parameters
scheme The scheme that the entities belong to
Returns
  • List of (GenericValue) entities
Throws
GenericEntityException If a DB error occurs

public List<GenericValue> getEntities (GenericValue scheme, String entityTypeId)

Throws
GenericEntityException

public List<GenericValue> getEntities (String type, String parameter)

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
GenericEntityException If a DB error occurs

public List<GenericValue> getEntities (GenericValue scheme, Long entityTypeId, String parameter)

Throws
GenericEntityException

public List<GenericValue> getEntities (GenericValue scheme, Long entityTypeId)

Throws
GenericEntityException

public GenericValue getEntity (Long id)

Gets a scheme entity based on the id of the entity

Parameters
id The id of the entity
Returns
  • The scheme entity object
Throws
GenericEntityException If a DB error occurs

public Collection<Group> getGroups (Long permissionId, Project project)

public Collection<Group> getGroups (Long permissionId, GenericValue project)

This method is deprecated.
Use getGroups(Long, com.atlassian.jira.project.Project) instead. Since v5.0.

@Deprecated public List<GenericValue> getProjects (GenericValue scheme)

This method is deprecated.
Use getProjects(Scheme) instead. Since 2009.

Gets all projects that are associated with that scheme

Parameters
scheme The scheme used to get all projects
Returns
  • List of (GenericValue) projects
Throws
GenericEntityException If a DB error occurs

public List<Project> getProjects (Scheme scheme)

Gets all projects that are associated with that scheme

Parameters
scheme The scheme used to get all projects
Returns

public GenericValue getScheme (Long id)

This method is deprecated.
Use getSchemeObject(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
GenericEntityException DB Error

public GenericValue getScheme (String name)

This method is deprecated.
use getSchemeObject(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
GenericEntityException DB error

public Scheme getSchemeFor (Project project)

Get the scheme of this type attached to the given project.

Parameters
project The project
Returns
  • Thoe associated schem for this project.

public Scheme getSchemeObject (String name)

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.

public Scheme getSchemeObject (Long id)

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.

public List<Scheme> getSchemeObjects ()

Gets all scheme objects in the database.

Returns
  • the schemes.
Throws
DataAccessException if the database is down or equivalent.

public List<GenericValue> getSchemes (GenericValue project)

This method is deprecated.
Use getSchemeFor(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
GenericEntityException If a DB error occurs

public List<GenericValue> getSchemes ()

This method is deprecated.
use getSchemeObjects(). Since 2010.

Gets all the Schemes (of the type defined by the subclass) from the database.

Returns
  • the schemes.
Throws
GenericEntityException DB Error

public List<Scheme> 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.

public Collection<User> getUsers (Long permissionId, Issue issue)

@Deprecated public Collection<User> getUsers (Long permissionId, GenericValue issueOrProject)

This method is deprecated.
Use getUsers(Long, com.atlassian.jira.permission.PermissionContext) instead. Since 2006.

public Collection<User> getUsers (Long permissionId, Project project)

public Collection<User> getUsers (Long permissionId, PermissionContext ctx)

public boolean hasSchemeAuthority (Long entityType, GenericValue entity, User user, boolean issueCreation)

Checks the given user's permission of the given permission type for the given entity.

Parameters
entityType permission type.
entity the entity to which permission is being checked.
user the user.
issueCreation whether the permission is for creating an issue.
Returns
  • true only if the user is permitted.

public boolean hasSchemeAuthority (Long entityType, GenericValue entity)

Checks anonymous permission of the given permission type for the given entity.

Parameters
entityType permission type.
entity the entity to which permission is being checked.
Returns
  • true only if the anonymous user is permitted.

public boolean removeEntities (GenericValue scheme, Long entityTypeId)

This method is deprecated.
Use getEntities(org.ofbiz.core.entity.GenericValue, Long) and deleteEntity(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 null
entityTypeId to remove
Returns
  • True all the time (legacy)
Throws
RemoveException if the delete fails (DB error)

public boolean removeEntities (String type, String parameter)

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)

public void removeSchemesFromProject (Project project)

Removes all schemes from a project

Parameters
project The project that all schemes are to be deleted from

public void removeSchemesFromProject (GenericValue project)

This method is deprecated.
Use removeSchemesFromProject(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
GenericEntityException If a DB error occurs

public boolean schemeExists (String name)

Determine if the given scheme name exists.

Parameters
name The name of the scheme
Returns
  • true is the schem exists.
Throws
GenericEntityException If a DB error occurs

public void updateScheme (Scheme scheme)

Updates any changes to the scheme object. This does not include changes to the scheme entities.

Parameters
scheme The modified scheme object

public void updateScheme (GenericValue entity)

This method is deprecated.
Use updateScheme(Scheme) instead. Since v5.0.

Updates any changes to the given scheme

Parameters
entity The modified scheme
Throws
GenericEntityException If a DB error occurs