com.atlassian.jira.event.type
Class DefaultEventTypeManager

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

public class DefaultEventTypeManager
extends Object
implements EventTypeManager


Field Summary
static String EVENT_TYPE_ID
           
 
Constructor Summary
DefaultEventTypeManager(OfBizDelegator delegator, WorkflowManager workflowManager, NotificationSchemeManager notificationSchemeManager)
           
 
Method Summary
 void addEventType(EventType eventType)
           
 void clearCache()
           
 void deleteEventType(Long eventTypeId)
           
 void editEventType(Long eventTypeId, String name, String description, Long templateId)
           
 Map<Long,String> getAssociatedNotificationSchemes(EventType eventType)
          Return a mapping of notification scheme ID to its name for each notification scheme that is associated with the specified eventType

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

 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)
          Returns the event type with the specified id
 Collection<EventType> getEventTypes()
          Returns an immutable collection of all known event types.
 Map<Long,EventType> getEventTypesMap()
          Returns an immutable map of all known event type IDs to the corresponding event types.
 boolean isActive(EventType eventType)
          Determine if the specified eventType is associated with any workflow or notification scheme.
 boolean isEventTypeExists(Long eventTypeId)
           
 boolean isEventTypeExists(String issueEventTypeName)
           
 void onClearCache(ClearCacheEvent event)
           
 
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)
Method Detail

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

getEventTypes

public Collection<EventType> getEventTypes()
Description copied from interface: EventTypeManager
Returns an immutable collection of all known event types.

This convenience method is exactly equivalent to EventTypeManager.getEventTypesMap().values().

Specified by:
getEventTypes in interface EventTypeManager
Returns:
an immutable collection of all known event types.

getEventTypesMap

public Map<Long,EventType> getEventTypesMap()
Description copied from interface: EventTypeManager
Returns an immutable map of all known event type IDs to the corresponding event types.

Specified by:
getEventTypesMap in interface EventTypeManager
Returns:
an immutable map of all known event type IDs to the corresponding event types.

getEventType

public EventType getEventType(Long id)
Description copied from interface: EventTypeManager
Returns the event type with the specified id

Specified by:
getEventType in interface EventTypeManager
Parameters:
id - The ID of the desired event type
Returns:
the event type with the specified id

isActive

public boolean isActive(EventType eventType)
Description copied from interface: EventTypeManager
Determine if the specified eventType is associated with any workflow or notification scheme.

Specified by:
isActive in interface EventTypeManager
Parameters:
eventType - event type
Returns:
true if eventType is associated with any workflow or notification scheme; false otherwise.

getAssociatedWorkflows

public org.apache.commons.collections.MultiMap getAssociatedWorkflows(EventType eventType,
                                                                      boolean statusCheck)
Description copied from interface: EventTypeManager
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 of WorkflowTransitionKeys to transitions

getAssociatedNotificationSchemes

public Map<Long,String> getAssociatedNotificationSchemes(EventType eventType)
Description copied from interface: EventTypeManager
Return a mapping of notification scheme ID to its name for each notification scheme that is associated with the specified eventType

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

Specified by:
getAssociatedNotificationSchemes in interface EventTypeManager
Parameters:
eventType - event type
Returns:
a mapping of notification scheme ID to its name

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-2013 Atlassian. All Rights Reserved.