com.atlassian.jira.notification
Class DefaultNotificationSchemeManager

java.lang.Object
  extended by com.atlassian.jira.scheme.AbstractSchemeManager
      extended by com.atlassian.jira.notification.DefaultNotificationSchemeManager
All Implemented Interfaces:
Startable, NotificationSchemeManager, SchemeManager

public class DefaultNotificationSchemeManager
extends AbstractSchemeManager
implements NotificationSchemeManager, Startable


Field Summary
 
Fields inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
projectManager
 
Fields inherited from interface com.atlassian.jira.scheme.SchemeManager
PROJECT_ASSOCIATION
 
Constructor Summary
DefaultNotificationSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, OfBizDelegator delegator, SchemeFactory schemeFactory, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme, org.ofbiz.core.entity.GenericValue entity)
           
 org.ofbiz.core.entity.GenericValue createDefaultScheme()
          Creates a default scheme, with an id of 0
 org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity)
           
 java.lang.String getAssociationType()
           
 java.lang.String getDefaultDescriptionKey()
           
 java.lang.String getDefaultNameKey()
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long eventTypeId)
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long eventTypeId, java.lang.String parameter)
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.String entityTypeId)
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.String type, java.lang.Long entityTypeId)
           
 java.lang.String getEntityName()
           
 org.ofbiz.core.entity.GenericValue getNotificationSchemeForProject(org.ofbiz.core.entity.GenericValue projectGV)
          Get the notification scheme for this project.
 java.util.Set<NotificationRecipient> getRecipients(IssueEvent event, SchemeEntity notification)
          Retrieve the set of recipients for the event using the specified notification entity.
 java.lang.String getSchemeDesc()
           
 java.lang.String getSchemeEntityName()
           
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getSchemesContainingEntity(java.lang.String type, java.lang.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.
 java.util.Map<java.lang.Long,java.lang.String> getSchemesMapByConditions(java.util.Map conditions)
          Retrieve a map of scheme ids to scheme names that match the specified conditions.
 boolean hasEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long eventTypeId, java.lang.String type, java.lang.String parameter, java.lang.Long templateId)
           
 boolean hasSchemeAuthority(java.lang.Long entityType, org.ofbiz.core.entity.GenericValue entity)
          Checks anonymous permission of the given permission type for the given entity.
 boolean hasSchemeAuthority(java.lang.Long entityType, org.ofbiz.core.entity.GenericValue entity, com.opensymphony.user.User user, boolean issueCreation)
          Checks the given user's permission of the given permission type for the given entity.
 boolean isHasMailServer()
           
 void onClearCache(ClearCacheEvent event)
           
 void removeSchemeEntitiesForField(java.lang.String customFieldId)
           
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createScheme, createSchemeAndEntities, createSchemeGenericValue, deleteEntity, deleteScheme, flushProjectSchemes, getAssociatedSchemes, getDefaultScheme, getEntities, getEntities, getEntity, getGroups, getProjectAndValidate, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, removeEntities, removeEntities, removeSchemesFromProject, removeSchemesFromProject, schemeExists, updateScheme, updateScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.scheme.SchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createScheme, createSchemeAndEntities, deleteEntity, deleteScheme, getAssociatedSchemes, getDefaultScheme, getEntities, getEntities, getEntity, getGroups, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, removeEntities, removeEntities, removeSchemesFromProject, removeSchemesFromProject, schemeExists, updateScheme, updateScheme
 

Constructor Detail

DefaultNotificationSchemeManager

public DefaultNotificationSchemeManager(ProjectManager projectManager,
                                        PermissionTypeManager permissionTypeManager,
                                        PermissionContextFactory permissionContextFactory,
                                        OfBizDelegator delegator,
                                        SchemeFactory schemeFactory,
                                        com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

start

public void start()
           throws java.lang.Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
java.lang.Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)
Overrides:
onClearCache in class AbstractSchemeManager

getSchemeEntityName

public java.lang.String getSchemeEntityName()
Specified by:
getSchemeEntityName in class AbstractSchemeManager

getEntityName

public java.lang.String getEntityName()
Specified by:
getEntityName in class AbstractSchemeManager

getAssociationType

public java.lang.String getAssociationType()
Specified by:
getAssociationType in class AbstractSchemeManager

getSchemeDesc

public java.lang.String getSchemeDesc()
Specified by:
getSchemeDesc in class AbstractSchemeManager

getDefaultNameKey

public java.lang.String getDefaultNameKey()
Specified by:
getDefaultNameKey in class AbstractSchemeManager

getDefaultDescriptionKey

public java.lang.String getDefaultDescriptionKey()
Specified by:
getDefaultDescriptionKey in class AbstractSchemeManager

createDefaultScheme

public org.ofbiz.core.entity.GenericValue createDefaultScheme()
                                                       throws org.ofbiz.core.entity.GenericEntityException
Description copied from class: AbstractSchemeManager
Creates a default scheme, with an id of 0

Specified by:
createDefaultScheme in interface SchemeManager
Overrides:
createDefaultScheme in class AbstractSchemeManager
Returns:
The new permission scheme object
Throws:
org.ofbiz.core.entity.GenericEntityException

removeSchemeEntitiesForField

public void removeSchemeEntitiesForField(java.lang.String customFieldId)
                                  throws RemoveException
Specified by:
removeSchemeEntitiesForField in interface NotificationSchemeManager
Throws:
RemoveException

getNotificationSchemeForProject

public org.ofbiz.core.entity.GenericValue getNotificationSchemeForProject(org.ofbiz.core.entity.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.

Specified by:
getNotificationSchemeForProject in interface NotificationSchemeManager
Parameters:
projectGV - the project
Returns:
notificationScheme the GenericValue object representing a notification scheme

getSchemesMapByConditions

public java.util.Map<java.lang.Long,java.lang.String> getSchemesMapByConditions(java.util.Map conditions)
Retrieve a map of scheme ids to scheme names that match the specified conditions.

Specified by:
getSchemesMapByConditions in interface NotificationSchemeManager
Parameters:
conditions - Map of conditions on which to limit the search
Returns:
Map scheme ids -> scheme names

getSchemesContainingEntity

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getSchemesContainingEntity(java.lang.String type,
                                                                                           java.lang.String parameter)
Description copied from interface: NotificationSchemeManager
This is a method that is meant to quickly get you all the schemes that contain an entity of the specified type and parameter.

Specified by:
getSchemesContainingEntity in interface NotificationSchemeManager
Parameters:
type - is the entity type
parameter - is the scheme entries parameter value
Returns:
Collection of GenericValues that represents a scheme

isHasMailServer

public boolean isHasMailServer()
                        throws com.atlassian.mail.MailException
Specified by:
isHasMailServer in interface NotificationSchemeManager
Throws:
com.atlassian.mail.MailException

createSchemeEntity

public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                             SchemeEntity schemeEntity)
                                                      throws org.ofbiz.core.entity.GenericEntityException
Specified by:
createSchemeEntity in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getRecipients

public java.util.Set<NotificationRecipient> getRecipients(IssueEvent event,
                                                          SchemeEntity notification)
                                                   throws org.ofbiz.core.entity.GenericEntityException
Retrieve the set of recipients for the event using the specified notification entity.

Specified by:
getRecipients in interface NotificationSchemeManager
Parameters:
event - issue event
notification - scheme entity
Returns:
a Set of notification recipients
Throws:
org.ofbiz.core.entity.GenericEntityException

hasEntities

public boolean hasEntities(org.ofbiz.core.entity.GenericValue scheme,
                           java.lang.Long eventTypeId,
                           java.lang.String type,
                           java.lang.String parameter,
                           java.lang.Long templateId)
                    throws org.ofbiz.core.entity.GenericEntityException
Specified by:
hasEntities in interface NotificationSchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

copySchemeEntity

public org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                           org.ofbiz.core.entity.GenericValue entity)
                                                    throws org.ofbiz.core.entity.GenericEntityException
Specified by:
copySchemeEntity in class AbstractSchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.String entityTypeId)
                           throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.Long eventTypeId)
                           throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.Long eventTypeId,
                                  java.lang.String parameter)
                           throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.String type,
                                  java.lang.Long entityTypeId)
                           throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

hasSchemeAuthority

public boolean hasSchemeAuthority(java.lang.Long entityType,
                                  org.ofbiz.core.entity.GenericValue entity)
Description copied from interface: SchemeManager
Checks anonymous permission of the given permission type for the given entity.

Specified by:
hasSchemeAuthority in interface SchemeManager
Parameters:
entityType - permission type.
entity - the entity to which permission is being checked.
Returns:
true only if the anonymous user is permitted.

hasSchemeAuthority

public boolean hasSchemeAuthority(java.lang.Long entityType,
                                  org.ofbiz.core.entity.GenericValue entity,
                                  com.opensymphony.user.User user,
                                  boolean issueCreation)
Description copied from interface: SchemeManager
Checks the given user's permission of the given permission type for the given entity.

Specified by:
hasSchemeAuthority in interface SchemeManager
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.


Copyright © 2002-2010 Atlassian. All Rights Reserved.