com.atlassian.jira.event.type
Class DefaultEventTypeManager

java.lang.Object
  extended by com.atlassian.jira.event.type.DefaultEventTypeManager
All Implemented Interfaces:
EventTypeManager, Startable

public class DefaultEventTypeManager
extends Object
implements EventTypeManager, Startable

Manages event types within the system.

Used to add, edit, delete and retrieve event types.


Field Summary
static String EVENT_TYPE_ID
           
 
Constructor Summary
DefaultEventTypeManager(OfBizDelegator delegator, WorkflowManager workflowManager, NotificationSchemeManager notificationSchemeManager, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void addEventType(EventType eventType)
           
 void clearCache()
           
 void deleteEventType(Long eventTypeId)
           
 void editEventType(Long eventTypeId, String name, String description, Long templateId)
           
 Map getAssociatedNotificationSchemes(EventType eventType)
          Return a collection of notificiation scheme names that the specified eventType is associated with.
 org.apache.commons.collections.MultiMap getAssociatedWorkflows(EventType eventType, boolean statusCheck)
          Determines which workflows and transitions are associated with the specified eventType.
 EventType getEventType(Long id)
          Retrieve the event type by the specified id.
 Collection getEventTypes()
           
 Map getEventTypesMap()
          Retrieve a map of all event types.
 boolean isActive(EventType eventType)
          Determine if the EventType specified is associated with a workflow and/or notification scheme.
 boolean isEventTypeExists(Long eventTypeId)
           
 boolean isEventTypeExists(String issueEventTypeName)
           
 void onClearCache(ClearCacheEvent event)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_TYPE_ID

public static final String EVENT_TYPE_ID
See Also:
Constant Field Values
Constructor Detail

DefaultEventTypeManager

public DefaultEventTypeManager(OfBizDelegator delegator,
                               WorkflowManager workflowManager,
                               NotificationSchemeManager notificationSchemeManager,
                               com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

start

public void start()
           throws 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:
Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

getEventTypes

public Collection getEventTypes()
Specified by:
getEventTypes in interface EventTypeManager

getEventTypesMap

public Map getEventTypesMap()
Retrieve a map of all event types.

Specified by:
getEventTypesMap in interface EventTypeManager
Returns:
eventTypesMap a map of eventTypeIds -> eventTypes

getEventType

public EventType getEventType(Long id)
Retrieve the event type by the specified id.

Specified by:
getEventType in interface EventTypeManager
Parameters:
id - ID
Returns:
EventType the event type with the specified id.

isActive

public boolean isActive(EventType eventType)
Determine if the EventType specified is associated with a workflow and/or notification scheme.

Specified by:
isActive in interface EventTypeManager
Parameters:
eventType - event type
Returns:
true if event type is associated with a workflow and/or notification scheme.

getAssociatedWorkflows

public org.apache.commons.collections.MultiMap getAssociatedWorkflows(EventType eventType,
                                                                      boolean statusCheck)
Determines which workflows and transitions are associated with the specified eventType.

The event type can be associated with a workflow through a post function on any of the workflow transitions.

Specified by:
getAssociatedWorkflows in interface EventTypeManager
Parameters:
eventType - event type
statusCheck - option to break on first association discovered - used when checking if event type is active
Returns:
MultiMap WorkflowTransitionKeys -> transitions

getAssociatedNotificationSchemes

public Map getAssociatedNotificationSchemes(EventType eventType)
Return a collection of notificiation scheme names that the specified eventType is associated with.

The event type can be associated with a notification scheme if the scheme has at least one notification type and template selected for the event type.

Specified by:
getAssociatedNotificationSchemes in interface EventTypeManager
Parameters:
eventType - event type
Returns:
Collection a collection of notificiation scheme names

addEventType

public void addEventType(EventType eventType)
Specified by:
addEventType in interface EventTypeManager

editEventType

public void editEventType(Long eventTypeId,
                          String name,
                          String description,
                          Long templateId)
Specified by:
editEventType in interface EventTypeManager

deleteEventType

public void deleteEventType(Long eventTypeId)
Specified by:
deleteEventType in interface EventTypeManager

isEventTypeExists

public boolean isEventTypeExists(String issueEventTypeName)
Specified by:
isEventTypeExists in interface EventTypeManager

isEventTypeExists

public boolean isEventTypeExists(Long eventTypeId)
Specified by:
isEventTypeExists in interface EventTypeManager

clearCache

public void clearCache()
Specified by:
clearCache in interface EventTypeManager


Copyright © 2002-2012 Atlassian. All Rights Reserved.