public class

DefaultNotificationSchemeManager

extends AbstractSchemeManager
implements Startable NotificationSchemeManager
java.lang.Object
   ↳ com.atlassian.jira.scheme.AbstractSchemeManager
     ↳ com.atlassian.jira.notification.DefaultNotificationSchemeManager

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.scheme.SchemeManager
[Expand]
Inherited Fields
From class com.atlassian.jira.scheme.AbstractSchemeManager
Public Constructors
DefaultNotificationSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, OfBizDelegator delegator, SchemeFactory schemeFactory, EventPublisher eventPublisher, NotificationTypeManager notificationTypeManager, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, UserPreferencesManager userPreferencesManager, CacheManager cacheManager)
Public Methods
GenericValue createDefaultScheme()
Creates a default scheme, with an id of 0
GenericValue createSchemeEntity(GenericValue scheme, SchemeEntity schemeEntity)
void deleteScheme(Long id)
Deletes a scheme from the database
String getDefaultDescriptionKey()
String getDefaultNameKey()
GenericValue getDefaultScheme()
Gets the default scheme.
List<GenericValue> getEntities(GenericValue scheme, String entityTypeId)
Inherited from SchemeManager.
List<GenericValue> getEntities(GenericValue scheme, String type, Long entityTypeId)
Inherited from SchemeManager.
List<GenericValue> getEntities(GenericValue scheme, Long eventTypeId, String parameter)
Inherited from SchemeManager.
List<GenericValue> getEntities(GenericValue scheme, Long eventTypeId)
Inherited from SchemeManager.
String getEntityName()
List<SchemeEntity> getNotificationSchemeEntities(Project project, long entityTypeId)
Get the notification scheme entities for this project and entity type.
GenericValue getNotificationSchemeForProject(GenericValue projectGV)
Get the notification scheme for this project.
Set<NotificationRecipient> getRecipients(IssueEvent event)
Given an issue event this method returns a set of NotificationRecipients who will receive an e-mail notification
Set<NotificationRecipient> getRecipients(IssueEvent event, SchemeEntity notification)
Retrieve the set of recipients for the event using the specified notification entity.
String getSchemeDesc()
String getSchemeEntityName()
@Nonnull Collection<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.
@Nonnull Map<LongString> getSchemesMapByConditions(Map<String, ?> conditions)
Retrieve a map of scheme ids to scheme names that match the specified conditions.
boolean hasEntities(GenericValue scheme, Long eventTypeId, String type, String parameter, Long templateId)
boolean isHasMailServer()
@EventListener 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.
Protected Methods
@Nonnull AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project)
@Nonnull AbstractSchemeCopiedEvent createSchemeCopiedEvent(Scheme oldScheme, Scheme newScheme)
AbstractSchemeEvent createSchemeCreatedEvent(Scheme scheme)
Object createSchemeEntityDeletedEvent(GenericValue entity)
GenericValue createSchemeEntityNoEvent(GenericValue scheme, SchemeEntity schemeEntity)
AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project)
AbstractSchemeUpdatedEvent createSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme)
I18nHelper getApplicationI18n()
SchemeEntity makeSchemeEntity(GenericValue schemeEntityGV)
[Expand]
Inherited Methods
From class com.atlassian.jira.scheme.AbstractSchemeManager
From class java.lang.Object
From interface com.atlassian.jira.extension.Startable
From interface com.atlassian.jira.notification.NotificationSchemeManager
From interface com.atlassian.jira.scheme.SchemeManager

Public Constructors

public DefaultNotificationSchemeManager (ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, OfBizDelegator delegator, SchemeFactory schemeFactory, EventPublisher eventPublisher, NotificationTypeManager notificationTypeManager, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, UserPreferencesManager userPreferencesManager, CacheManager cacheManager)

Public Methods

public GenericValue createDefaultScheme ()

Creates a default scheme, with an id of 0

Returns
  • The new permission scheme object
Throws
GenericEntityException

public GenericValue createSchemeEntity (GenericValue scheme, SchemeEntity schemeEntity)

Throws
GenericEntityException

public void deleteScheme (Long id)

Deletes a scheme from the database

Parameters
id Id of the scheme to be deleted
Throws
GenericEntityException

public String getDefaultDescriptionKey ()

public String getDefaultNameKey ()

public GenericValue getDefaultScheme ()

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

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

Inherited from SchemeManager.

Throws
GenericEntityException

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

Inherited from SchemeManager.

Throws
GenericEntityException

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

Inherited from SchemeManager.

Throws
GenericEntityException

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

Inherited from SchemeManager.

Throws
GenericEntityException

public String getEntityName ()

public List<SchemeEntity> getNotificationSchemeEntities (Project project, long entityTypeId)

Get the notification scheme entities for this project and entity type.

Returns an empty List if there problems (e.g. more than one scheme association for the Project) encountered.

Parameters
project the project
entityTypeId the type of entity
Returns
  • notificationSchemeEntities scheme entities representing the notifications for the project
Throws
GenericEntityException

public GenericValue getNotificationSchemeForProject (GenericValue projectGV)

Get the notification scheme for this project. There should be only one.

Returns null if there problems (e.g. more than one scheme association) encountered.

Parameters
projectGV the project
Returns
  • notificationScheme the GenericValue object representing a notification scheme

public Set<NotificationRecipient> getRecipients (IssueEvent event)

Given an issue event this method returns a set of NotificationRecipients who will receive an e-mail notification

Parameters
event The issue event that triggered the notification
Returns
  • A Set of recipients that will receive e-mails for this event.

public Set<NotificationRecipient> getRecipients (IssueEvent event, SchemeEntity notification)

Retrieve the set of recipients for the event using the specified notification entity.

Parameters
event issue event
notification scheme entity
Returns
  • a Set of notification recipients
Throws
GenericEntityException

public String getSchemeDesc ()

public String getSchemeEntityName ()

@Nonnull public Collection<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.

Parameters
type is the entity type
parameter is the scheme entries parameter value
Returns
  • Collection of GenericValues that represents a scheme

@Nonnull public Map<LongString> getSchemesMapByConditions (Map<String, ?> conditions)

Retrieve a map of scheme ids to scheme names that match the specified conditions.

Parameters
conditions Map of conditions on which to limit the search
Returns
  • Map scheme ids -> scheme names

public boolean hasEntities (GenericValue scheme, Long eventTypeId, String type, String parameter, Long templateId)

Throws
GenericEntityException

public boolean isHasMailServer ()

Throws
MailException

@EventListener public void onClearCache (ClearCacheEvent event)

public void removeSchemeEntitiesForField (String customFieldId)

public void start ()

This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Throws
Exception

Protected Methods

@Nonnull protected AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent (Scheme scheme, Project project)

@Nonnull protected AbstractSchemeCopiedEvent createSchemeCopiedEvent (Scheme oldScheme, Scheme newScheme)

protected AbstractSchemeEvent createSchemeCreatedEvent (Scheme scheme)

protected Object createSchemeEntityDeletedEvent (GenericValue entity)

protected GenericValue createSchemeEntityNoEvent (GenericValue scheme, SchemeEntity schemeEntity)

Throws
GenericEntityException

protected AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent (Scheme scheme, Project project)

protected AbstractSchemeUpdatedEvent createSchemeUpdatedEvent (Scheme scheme, Scheme originalScheme)

protected I18nHelper getApplicationI18n ()

protected SchemeEntity makeSchemeEntity (GenericValue schemeEntityGV)