public abstract class AbstractSchemeManager extends Object implements SchemeManager
| Modifier and Type | Field and Description |
|---|---|
protected com.atlassian.event.api.EventPublisher |
eventPublisher |
protected GroupManager |
groupManager |
protected ProjectManager |
projectManager |
protected SchemeFactory |
schemeFactory |
protected SecurityTypeManager |
securityTypeManager |
PROJECT_ASSOCIATION| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSchemeManager(ProjectManager projectManager,
SecurityTypeManager securityTypeManager,
PermissionContextFactory permissionContextFactory,
SchemeFactory schemeFactory,
NodeAssociationStore nodeAssociationStore,
OfBizDelegator ofBizDelegator,
GroupManager groupManager,
com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultSchemeToProject(org.ofbiz.core.entity.GenericValue project)
Adds the default scheme to a particular project
|
void |
addDefaultSchemeToProject(Project project)
Adds the default scheme to a particular project
|
void |
addSchemeToProject(org.ofbiz.core.entity.GenericValue project,
org.ofbiz.core.entity.GenericValue scheme)
Deprecated.
|
void |
addSchemeToProject(Project project,
Scheme scheme)
Adds a scheme to a particular project
|
org.ofbiz.core.entity.GenericValue |
copyScheme(org.ofbiz.core.entity.GenericValue oldScheme)
Copys a scheme, giving the new scheme the same entities as the original one
|
Scheme |
copyScheme(Scheme oldScheme)
Copys a scheme, giving the new scheme the same entities as the original one
|
org.ofbiz.core.entity.GenericValue |
createDefaultScheme()
Creates a default scheme, with an id of 0
|
org.ofbiz.core.entity.GenericValue |
createScheme(String name,
String description)
Creates a new scheme
|
protected abstract AbstractSchemeAddedToProjectEvent |
createSchemeAddedToProjectEvent(Scheme scheme,
Project project) |
Scheme |
createSchemeAndEntities(Scheme scheme) |
protected abstract AbstractSchemeCopiedEvent |
createSchemeCopiedEvent(Scheme oldScheme,
Scheme newScheme) |
protected abstract AbstractSchemeEvent |
createSchemeCreatedEvent(Scheme scheme) |
protected abstract Object |
createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity) |
protected abstract org.ofbiz.core.entity.GenericValue |
createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity) |
protected org.ofbiz.core.entity.GenericValue |
createSchemeGenericValue(Map<String,Object> values) |
protected org.ofbiz.core.entity.GenericValue |
createSchemeNoEvent(String name,
String description) |
Scheme |
createSchemeObject(String name,
String description)
Creates a new scheme
|
protected abstract AbstractSchemeRemovedFromProjectEvent |
createSchemeRemovedFromProjectEvent(Scheme scheme,
Project project) |
protected abstract AbstractSchemeUpdatedEvent |
createSchemeUpdatedEvent(Scheme scheme,
Scheme originalScheme) |
void |
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 database
|
protected void |
flushProjectSchemes() |
protected I18nHelper |
getApplicationI18n() |
List<Scheme> |
getAssociatedSchemes(boolean withEntitiesComparable)
Gets all schemes of this type in the database taht are associated with at least one project.
|
String |
getAssociationType()
Deprecated.
Just assume all schemes are project association schemes.
|
abstract String |
getDefaultDescriptionKey() |
abstract String |
getDefaultNameKey() |
org.ofbiz.core.entity.GenericValue |
getDefaultScheme()
Gets the default scheme.
|
Scheme |
getDefaultSchemeObject()
Gets the default scheme.
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme)
Get all Scheme entity records for a particular scheme
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(String type,
String parameter)
Get all entity records with a particular parameter
|
List<org.ofbiz.core.entity.GenericValue> |
getEntitiesByIds(List<Long> ids)
Get all entity records for a list of ids
|
org.ofbiz.core.entity.GenericValue |
getEntity(Long id)
Gets a scheme entity based on the id of the entity
|
abstract String |
getEntityName() |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroups(Long entityTypeId,
org.ofbiz.core.entity.GenericValue project) |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroups(Long entityTypeId,
Project project) |
String |
getNameForCopy(String originalName,
Integer abbreviateTo) |
List<Project> |
getProjects(Scheme scheme)
Gets all projects that are associated with that scheme
|
org.ofbiz.core.entity.GenericValue |
getScheme(Long id)
Gets a scheme based on the Id of the scheme
|
org.ofbiz.core.entity.GenericValue |
getScheme(String name)
Gets a scheme by name from the database.
|
abstract String |
getSchemeDesc() |
abstract String |
getSchemeEntityName() |
Scheme |
getSchemeFor(Project project)
Get the scheme of this type attached to the given project.
|
Long |
getSchemeIdFor(Project project)
Get the scheme of this type attached to the given project.
|
Scheme |
getSchemeObject(Long id)
Gets a scheme by id from the database.
|
Scheme |
getSchemeObject(String name)
Gets a scheme by name from the database.
|
List<Scheme> |
getSchemeObjects()
Gets all scheme objects in the database.
|
List<org.ofbiz.core.entity.GenericValue> |
getSchemes()
Gets all the Schemes (of the type defined by the subclass) from the database.
|
List<org.ofbiz.core.entity.GenericValue> |
getSchemes(org.ofbiz.core.entity.GenericValue project)
Get all schemes of this type attached to the given project.
|
List<Scheme> |
getUnassociatedSchemes()
Will return all @link Scheme objects that are not currently associated with any projects.
|
Collection<ApplicationUser> |
getUsers(Long permissionId,
org.ofbiz.core.entity.GenericValue projectOrIssue) |
Collection<ApplicationUser> |
getUsers(Long permissionId,
Issue issue) |
Collection<ApplicationUser> |
getUsers(Long permissionId,
PermissionContext ctx) |
Collection<ApplicationUser> |
getUsers(Long permissionId,
Project project) |
protected abstract SchemeEntity |
makeSchemeEntity(org.ofbiz.core.entity.GenericValue schemeEntityGV) |
void |
onClearCache(ClearCacheEvent event) |
boolean |
removeEntities(org.ofbiz.core.entity.GenericValue scheme,
Long entityTypeId)
Retrieves all the entites for this permission and then removes them.
|
boolean |
removeEntities(String type,
String parameter)
Removes all scheme entities with this parameter and type
|
void |
removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project)
Deprecated.
|
void |
removeSchemesFromProject(Project project)
Removes all schemes from a project
|
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 parameter
|
void |
updateScheme(org.ofbiz.core.entity.GenericValue entity)
Updates any changes to the given scheme
|
void |
updateScheme(Scheme scheme)
Updates any changes to the scheme object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateSchemeEntity, getEntities, getEntities, getEntities, getEntitiesprotected final ProjectManager projectManager
protected final SecurityTypeManager securityTypeManager
protected final SchemeFactory schemeFactory
protected final GroupManager groupManager
protected final com.atlassian.event.api.EventPublisher eventPublisher
protected AbstractSchemeManager(ProjectManager projectManager, SecurityTypeManager securityTypeManager, PermissionContextFactory permissionContextFactory, SchemeFactory schemeFactory, NodeAssociationStore nodeAssociationStore, OfBizDelegator ofBizDelegator, GroupManager groupManager, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.cache.CacheManager cacheManager)
public void onClearCache(ClearCacheEvent event)
public abstract String getSchemeEntityName()
public abstract String getEntityName()
public abstract String getSchemeDesc()
public abstract String getDefaultNameKey()
public abstract String getDefaultDescriptionKey()
@Deprecated public String getAssociationType()
projects or something else. This is here for historic reasons as schemes are
now always associated with projects. This means you should not override this.protected abstract org.ofbiz.core.entity.GenericValue createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity)
throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityExceptionpublic org.ofbiz.core.entity.GenericValue getScheme(Long id)
SchemeManagergetScheme in interface SchemeManagerid - Id of the scheme@Nullable public Scheme getSchemeObject(Long id) throws DataAccessException
SchemeManagergetSchemeObject in interface SchemeManagerid - the id of the scheme to get.DataAccessException - if there is trouble retrieving from the database.@Nullable public Scheme getSchemeObject(String name) throws DataAccessException
SchemeManagergetSchemeObject in interface SchemeManagername - the name of the scheme to get.DataAccessException - if there is trouble retrieving from the database.public org.ofbiz.core.entity.GenericValue getScheme(String name) throws DataAccessException
SchemeManagergetScheme in interface SchemeManagername - the name of the scheme to get.DataAccessExceptionpublic List<org.ofbiz.core.entity.GenericValue> getSchemes() throws DataAccessException
SchemeManagergetSchemes in interface SchemeManagerDataAccessExceptionpublic List<Scheme> getSchemeObjects() throws DataAccessException
SchemeManagergetSchemeObjects in interface SchemeManagerDataAccessException - if the database is down or equivalent.public List<Scheme> getAssociatedSchemes(boolean withEntitiesComparable) throws DataAccessException
SchemeManagergetAssociatedSchemes in interface SchemeManagerwithEntitiesComparable - 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.DataAccessExceptionpublic List<Scheme> getUnassociatedSchemes() throws DataAccessException
SchemeManagergetUnassociatedSchemes in interface SchemeManagerDataAccessException - if the database is down or equivalent.public List<org.ofbiz.core.entity.GenericValue> getSchemes(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagergetSchemes in interface SchemeManagerproject - The project that the schemes are attached toorg.ofbiz.core.entity.GenericEntityException - If a DB error occurs@Nullable public Scheme getSchemeFor(Project project)
SchemeManagergetSchemeFor in interface SchemeManagerproject - The projectSchemeManager.getSchemeIdFor(Project)@Nullable public Long getSchemeIdFor(Project project)
SchemeManagergetSchemeIdFor in interface SchemeManagerproject - The projectSchemeManager.getSchemeFor(Project)public org.ofbiz.core.entity.GenericValue getEntity(Long id)
SchemeManagergetEntity in interface SchemeManagerid - The id of the entitypublic List<org.ofbiz.core.entity.GenericValue> getEntities(String type, String parameter) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagergetEntities in interface SchemeManagertype - The type of entity you wish to retrieve, eg 'user', 'group', 'projectrole'parameter - The parameter in the entityorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic List<org.ofbiz.core.entity.GenericValue> getEntitiesByIds(List<Long> ids)
SchemeManagergetEntitiesByIds in interface SchemeManagerids - a collection of entity ids that should be retrievedpublic List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagergetEntities in interface SchemeManagerscheme - The scheme that the entities belong toorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic boolean schemeExists(String name)
SchemeManagerschemeExists in interface SchemeManagername - The name of the schemepublic org.ofbiz.core.entity.GenericValue createScheme(String name, String description) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagercreateScheme in interface SchemeManagername - The name of the new schemedescription - The description of the new schemeorg.ofbiz.core.entity.GenericEntityException - If a DB error occursprotected org.ofbiz.core.entity.GenericValue createSchemeNoEvent(String name, String description) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityExceptionprotected abstract AbstractSchemeEvent createSchemeCreatedEvent(Scheme scheme)
public Scheme createSchemeObject(String name, String description)
SchemeManagercreateSchemeObject in interface SchemeManagername - The name of the new schemedescription - The description of the new schemepublic Scheme createSchemeAndEntities(Scheme scheme) throws DataAccessException
createSchemeAndEntities in interface SchemeManagerDataAccessExceptionprotected abstract AbstractSchemeUpdatedEvent createSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme)
public void updateScheme(org.ofbiz.core.entity.GenericValue entity)
throws org.ofbiz.core.entity.GenericEntityException
SchemeManagerupdateScheme in interface SchemeManagerentity - The modified schemeorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic void updateScheme(Scheme scheme) throws DataAccessException
SchemeManagerupdateScheme in interface SchemeManagerscheme - The modified scheme objectDataAccessExceptionpublic void deleteScheme(Long id) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagerdeleteScheme in interface SchemeManagerid - Id of the scheme to be deletedorg.ofbiz.core.entity.GenericEntityException - If a DB error occurs@Deprecated public void addSchemeToProject(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException
SchemeManageraddSchemeToProject in interface SchemeManagerproject - The project that the scheme is to be added toscheme - The scheme to be addedorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic void addSchemeToProject(Project project, Scheme scheme) throws DataAccessException
SchemeManageraddSchemeToProject in interface SchemeManagerproject - The project that the scheme is to be added toscheme - The scheme to be addedDataAccessException@Nonnull protected abstract AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project)
public void removeSchemesFromProject(Project project) throws DataAccessException
SchemeManagerremoveSchemesFromProject in interface SchemeManagerproject - The project that all schemes are to be deleted fromDataAccessException@Deprecated public void removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException
SchemeManagerremoveSchemesFromProject in interface SchemeManagerproject - The project that all schemes are to be deleted fromorg.ofbiz.core.entity.GenericEntityException - If a DB error occurs@Nonnull protected abstract AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project)
public void deleteEntity(Long id) throws DataAccessException
SchemeManagerdeleteEntity in interface SchemeManagerid - The id of the entity to be deletedDataAccessExceptionpublic void deleteEntities(Iterable<Long> ids) throws DataAccessException
SchemeManagerdeleteEntities in interface SchemeManagerids - a collection entity ids to be deleted.DataAccessExceptionpublic void swapParameterForEntitiesOfType(String type, String parameter, String resultingParameter)
SchemeManagerswapParameterForEntitiesOfType in interface SchemeManagertype - the 'type' of entity you are swapping, eg 'group', 'user', 'projectrole'parameter - must NOT be nullprotected abstract SchemeEntity makeSchemeEntity(org.ofbiz.core.entity.GenericValue schemeEntityGV)
@Nullable protected abstract Object createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity)
public List<Project> getProjects(Scheme scheme) throws DataAccessException
SchemeManagergetProjects in interface SchemeManagerscheme - The scheme used to get all projectsProject'sDataAccessExceptionpublic org.ofbiz.core.entity.GenericValue createDefaultScheme()
throws org.ofbiz.core.entity.GenericEntityException
SchemeManagercreateDefaultScheme in interface SchemeManagerorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic boolean removeEntities(String type, String parameter) throws RemoveException
SchemeManagerremoveEntities in interface SchemeManagertype - the 'type' of entity you are deleting, eg 'group', 'user', 'projectrole'parameter - must NOT be nullRemoveException - if the delete fails (DB error)public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme,
Long entityTypeId)
throws RemoveException
SchemeManagerremoveEntities in interface SchemeManagerscheme - to remove entites from must NOT be nullentityTypeId - to removeRemoveException - if the delete fails (DB error)public org.ofbiz.core.entity.GenericValue getDefaultScheme()
throws org.ofbiz.core.entity.GenericEntityException
SchemeManagerThis does not work for the Default Notification scheme as it does not have an id of 0.
getDefaultScheme in interface SchemeManagerorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic Scheme getDefaultSchemeObject()
SchemeManagerThis does not work for the Default Notification scheme as it does not have an id of 0.
getDefaultSchemeObject in interface SchemeManagerpublic void addDefaultSchemeToProject(org.ofbiz.core.entity.GenericValue project)
throws org.ofbiz.core.entity.GenericEntityException
SchemeManageraddDefaultSchemeToProject in interface SchemeManagerproject - The project that the scheme is to be added toorg.ofbiz.core.entity.GenericEntityException - If a DB error occurspublic void addDefaultSchemeToProject(Project project) throws DataAccessException
SchemeManageraddDefaultSchemeToProject in interface SchemeManagerproject - The project that the scheme is to be added toDataAccessExceptionpublic org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue oldScheme)
throws org.ofbiz.core.entity.GenericEntityException
SchemeManagercopyScheme in interface SchemeManageroldScheme - The permission scheme to be copiedorg.ofbiz.core.entity.GenericEntityException - If a DB error occurs@Nonnull protected abstract AbstractSchemeCopiedEvent createSchemeCopiedEvent(@Nonnull Scheme oldScheme, @Nonnull Scheme newScheme)
public Scheme copyScheme(Scheme oldScheme)
SchemeManagercopyScheme in interface SchemeManageroldScheme - The permission scheme to be copiedprotected void flushProjectSchemes()
public Collection<com.atlassian.crowd.embedded.api.Group> getGroups(Long entityTypeId, Project project)
getGroups in interface SchemeManagerpublic Collection<com.atlassian.crowd.embedded.api.Group> getGroups(Long entityTypeId, org.ofbiz.core.entity.GenericValue project)
getGroups in interface SchemeManagerpublic Collection<ApplicationUser> getUsers(Long permissionId, org.ofbiz.core.entity.GenericValue projectOrIssue)
getUsers in interface SchemeManagerpublic Collection<ApplicationUser> getUsers(Long permissionId, Project project)
getUsers in interface SchemeManagerpublic Collection<ApplicationUser> getUsers(Long permissionId, Issue issue)
getUsers in interface SchemeManagerpublic Collection<ApplicationUser> getUsers(Long permissionId, PermissionContext ctx)
getUsers in interface SchemeManagerprotected org.ofbiz.core.entity.GenericValue createSchemeGenericValue(Map<String,Object> values) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityExceptionprotected I18nHelper getApplicationI18n()
Copyright © 2002-2018 Atlassian. All Rights Reserved.