public class DefaultNotificationSchemeManager extends AbstractSchemeManager implements NotificationSchemeManager, Startable
eventPublisher, groupManager, projectManager, schemeFactory, securityTypeManager
PROJECT_ASSOCIATION
Constructor and Description |
---|
DefaultNotificationSchemeManager(ProjectManager projectManager,
PermissionTypeManager permissionTypeManager,
PermissionContextFactory permissionContextFactory,
OfBizDelegator delegator,
SchemeFactory schemeFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
NotificationTypeManager notificationTypeManager,
NodeAssociationStore nodeAssociationStore,
GroupManager groupManager,
UserPreferencesManager userPreferencesManager,
com.atlassian.cache.CacheManager cacheManager,
ApplicationRoleManager applicationRoleManager,
FeatureManager featureManager) |
Modifier and Type | Method and Description |
---|---|
org.ofbiz.core.entity.GenericValue |
createDefaultScheme()
Creates a default scheme, with an id of 0
|
protected AbstractSchemeAddedToProjectEvent |
createSchemeAddedToProjectEvent(Scheme scheme,
Project project) |
protected AbstractSchemeCopiedEvent |
createSchemeCopiedEvent(Scheme oldScheme,
Scheme newScheme) |
protected AbstractSchemeEvent |
createSchemeCreatedEvent(Scheme scheme) |
org.ofbiz.core.entity.GenericValue |
createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity) |
protected Object |
createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity) |
protected org.ofbiz.core.entity.GenericValue |
createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity) |
protected AbstractSchemeRemovedFromProjectEvent |
createSchemeRemovedFromProjectEvent(Scheme scheme,
Project project) |
protected AbstractSchemeUpdatedEvent |
createSchemeUpdatedEvent(Scheme scheme,
Scheme originalScheme) |
void |
deleteScheme(Long id)
Deletes a scheme from the database
|
protected I18nHelper |
getApplicationI18n() |
String |
getDefaultDescriptionKey() |
String |
getDefaultNameKey() |
org.ofbiz.core.entity.GenericValue |
getDefaultScheme()
Gets the default scheme.
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
Long eventTypeId)
Inherited from SchemeManager.
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
Long eventTypeId,
String parameter)
Inherited from SchemeManager.
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
String entityTypeId)
Inherited from SchemeManager.
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
String type,
Long entityTypeId)
Inherited from SchemeManager.
|
String |
getEntityName() |
List<SchemeEntity> |
getNotificationSchemeEntities(Project project,
long entityTypeId)
Get the notification scheme entities for this project and entity type.
|
org.ofbiz.core.entity.GenericValue |
getNotificationSchemeForProject(org.ofbiz.core.entity.GenericValue projectGV)
Get the notification scheme for this project.
|
Set<NotificationRecipient> |
getRecipients(IssueEvent event)
Given an issue event this method returns a set of
NotificationRecipient s who will receive an e-mail
notification |
Set<NotificationRecipient> |
getRecipients(IssueEvent event,
SchemeEntity scheme)
Retrieve the set of recipients for the event using the specified notification entity.
|
String |
getSchemeDesc() |
String |
getSchemeEntityName() |
Collection<org.ofbiz.core.entity.GenericValue> |
getSchemesContainingEntity(String type,
String parameter)
This is a method that is meant to quickly get you all the schemes that contain an entity of the
specified type and parameter.
|
Map<Long,String> |
getSchemesMapByConditions(Map<String,?> conditions)
Retrieve a map of scheme ids to scheme names that match the specified conditions.
|
boolean |
hasEntities(org.ofbiz.core.entity.GenericValue scheme,
Long eventTypeId,
String type,
String parameter,
Long templateId) |
boolean |
isHasMailServer() |
protected SchemeEntity |
makeSchemeEntity(org.ofbiz.core.entity.GenericValue schemeEntityGV) |
void |
onClearCache(ClearCacheEvent event) |
void |
removeSchemeEntitiesForField(String customFieldId) |
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, copyScheme, createScheme, createSchemeAndEntities, createSchemeGenericValue, createSchemeNoEvent, createSchemeObject, deleteEntities, deleteEntity, flushProjectSchemes, getAssociatedSchemes, getAssociationType, getDefaultSchemeObject, getEntities, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getNameForCopy, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, removeEntities, removeEntities, removeSchemesFromProject, removeSchemesFromProject, schemeExists, swapParameterForEntitiesOfType, updateScheme, updateScheme
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEntities
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, copyScheme, createScheme, createSchemeAndEntities, createSchemeObject, deleteEntities, deleteEntity, getAssociatedSchemes, getDefaultSchemeObject, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, removeEntities, removeEntities, removeSchemesFromProject, removeSchemesFromProject, schemeExists, swapParameterForEntitiesOfType, updateScheme, updateScheme
public DefaultNotificationSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, OfBizDelegator delegator, SchemeFactory schemeFactory, com.atlassian.event.api.EventPublisher eventPublisher, NotificationTypeManager notificationTypeManager, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, UserPreferencesManager userPreferencesManager, com.atlassian.cache.CacheManager cacheManager, ApplicationRoleManager applicationRoleManager, FeatureManager featureManager)
public void start() throws Exception
Startable
@EventListener public void onClearCache(ClearCacheEvent event)
onClearCache
in class AbstractSchemeManager
public String getSchemeEntityName()
getSchemeEntityName
in class AbstractSchemeManager
public String getEntityName()
getEntityName
in class AbstractSchemeManager
public String getSchemeDesc()
getSchemeDesc
in class AbstractSchemeManager
public String getDefaultNameKey()
getDefaultNameKey
in class AbstractSchemeManager
public String getDefaultDescriptionKey()
getDefaultDescriptionKey
in class AbstractSchemeManager
protected AbstractSchemeEvent createSchemeCreatedEvent(Scheme scheme)
createSchemeCreatedEvent
in class AbstractSchemeManager
@Nonnull protected AbstractSchemeCopiedEvent createSchemeCopiedEvent(@Nonnull Scheme oldScheme, @Nonnull Scheme newScheme)
createSchemeCopiedEvent
in class AbstractSchemeManager
protected AbstractSchemeUpdatedEvent createSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme)
createSchemeUpdatedEvent
in class AbstractSchemeManager
public void deleteScheme(Long id) throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
deleteScheme
in interface SchemeManager
deleteScheme
in class AbstractSchemeManager
id
- Id of the scheme to be deletedorg.ofbiz.core.entity.GenericEntityException
- If a DB error occurs@Nonnull protected AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project)
createSchemeAddedToProjectEvent
in class AbstractSchemeManager
public org.ofbiz.core.entity.GenericValue getDefaultScheme() throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
This does not work for the Default Notification scheme as it does not have an id of 0.
getDefaultScheme
in interface SchemeManager
getDefaultScheme
in class AbstractSchemeManager
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurspublic org.ofbiz.core.entity.GenericValue createDefaultScheme() throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
createDefaultScheme
in interface SchemeManager
createDefaultScheme
in class AbstractSchemeManager
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurspublic void removeSchemeEntitiesForField(String customFieldId) throws RemoveException
removeSchemeEntitiesForField
in interface NotificationSchemeManager
RemoveException
protected SchemeEntity makeSchemeEntity(org.ofbiz.core.entity.GenericValue schemeEntityGV)
makeSchemeEntity
in class AbstractSchemeManager
protected Object createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity)
createSchemeEntityDeletedEvent
in class AbstractSchemeManager
public List<SchemeEntity> getNotificationSchemeEntities(Project project, long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
Returns an empty List if there problems (e.g. more than one scheme association for the Project) encountered.
getNotificationSchemeEntities
in interface NotificationSchemeManager
project
- the projectentityTypeId
- the type of entityorg.ofbiz.core.entity.GenericEntityException
public org.ofbiz.core.entity.GenericValue getNotificationSchemeForProject(org.ofbiz.core.entity.GenericValue projectGV)
NotificationSchemeManager
Returns null if there problems (e.g. more than one scheme association) encountered.
getNotificationSchemeForProject
in interface NotificationSchemeManager
projectGV
- the project@Nonnull public Map<Long,String> getSchemesMapByConditions(Map<String,?> conditions)
NotificationSchemeManager
getSchemesMapByConditions
in interface NotificationSchemeManager
conditions
- Map of conditions on which to limit the search@Nonnull public Collection<org.ofbiz.core.entity.GenericValue> getSchemesContainingEntity(String type, String parameter)
NotificationSchemeManager
getSchemesContainingEntity
in interface NotificationSchemeManager
type
- is the entity typeparameter
- is the scheme entries parameter valuepublic boolean isHasMailServer() throws com.atlassian.mail.MailException
isHasMailServer
in interface NotificationSchemeManager
com.atlassian.mail.MailException
public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException
createSchemeEntity
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
protected org.ofbiz.core.entity.GenericValue createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException
createSchemeEntityNoEvent
in class AbstractSchemeManager
org.ofbiz.core.entity.GenericEntityException
public Set<NotificationRecipient> getRecipients(IssueEvent event, SchemeEntity scheme) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
getRecipients
in interface NotificationSchemeManager
event
- issue eventscheme
- scheme entityorg.ofbiz.core.entity.GenericEntityException
public Set<NotificationRecipient> getRecipients(IssueEvent event)
NotificationSchemeManager
NotificationRecipient
s who will receive an e-mail
notificationgetRecipients
in interface NotificationSchemeManager
event
- The issue event that triggered the notificationpublic boolean hasEntities(org.ofbiz.core.entity.GenericValue scheme, Long eventTypeId, String type, String parameter, Long templateId) throws org.ofbiz.core.entity.GenericEntityException
hasEntities
in interface NotificationSchemeManager
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String entityTypeId) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
getEntities
in interface NotificationSchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long eventTypeId) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
getEntities
in interface NotificationSchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long eventTypeId, String parameter) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
getEntities
in interface NotificationSchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long entityTypeId) throws org.ofbiz.core.entity.GenericEntityException
NotificationSchemeManager
getEntities
in interface NotificationSchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
@Nonnull protected AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project)
createSchemeRemovedFromProjectEvent
in class AbstractSchemeManager
protected I18nHelper getApplicationI18n()
getApplicationI18n
in class AbstractSchemeManager
Copyright © 2002-2023 Atlassian. All Rights Reserved.