com.atlassian.jira.config
Class DefaultReindexMessageManager

java.lang.Object
  extended by com.atlassian.jira.config.DefaultReindexMessageManager
All Implemented Interfaces:
ReindexMessageManager, Startable

public class DefaultReindexMessageManager
extends Object
implements ReindexMessageManager, Startable

Default implementation of the Reindex Message Manager that uses a simple PropertySet to store the last message pushed.

Since:
v4.0

Constructor Summary
DefaultReindexMessageManager(JiraPropertySetFactory jiraPropertySetFactory, UserKeyService userKeyService, UserFormatManager userFormatManager, I18nHelper.BeanFactory i18nFactory, OutlookDateManager outlookDateManager, VelocityRequestContextFactory velocityRequestContextFactory, PermissionManager permissionManager, TaskManager taskManager, com.atlassian.cache.CacheManager cacheManager, com.atlassian.beehive.ClusterLockService clusterLockService)
           
 
Method Summary
 void clear()
          Clears any current message.
 void clearMessageForTimestamp(Date time)
          Clears message if it was posted before a specific time
 String getMessage(com.atlassian.crowd.embedded.api.User user)
          Get current message localised for given user.
 ReindexMessage getMessageObject()
          Get current message object for given user.
 void onClearCache(ClearCacheEvent event)
           
 void pushMessage(com.atlassian.crowd.embedded.api.User user, String i18nTask)
          Pushes a new message.
 void pushRawMessage(com.atlassian.crowd.embedded.api.User user, String i18nMessage)
          Pushes a new raw message.
 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
 

Constructor Detail

DefaultReindexMessageManager

public DefaultReindexMessageManager(JiraPropertySetFactory jiraPropertySetFactory,
                                    UserKeyService userKeyService,
                                    UserFormatManager userFormatManager,
                                    I18nHelper.BeanFactory i18nFactory,
                                    OutlookDateManager outlookDateManager,
                                    VelocityRequestContextFactory velocityRequestContextFactory,
                                    PermissionManager permissionManager,
                                    TaskManager taskManager,
                                    com.atlassian.cache.CacheManager cacheManager,
                                    com.atlassian.beehive.ClusterLockService clusterLockService)
Method Detail

start

public void start()
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

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)

pushMessage

public void pushMessage(com.atlassian.crowd.embedded.api.User user,
                        String i18nTask)
Description copied from interface: ReindexMessageManager
Pushes a new message. This will replace any existing messages.

Specified by:
pushMessage in interface ReindexMessageManager
Parameters:
user - the user performing the task. May be null, in which case a more generic notification will be displayed
i18nTask - the i18n key of the task being performed.

pushRawMessage

public void pushRawMessage(com.atlassian.crowd.embedded.api.User user,
                           String i18nMessage)
Description copied from interface: ReindexMessageManager
Pushes a new raw message. This will replace any existing messages.

Specified by:
pushRawMessage in interface ReindexMessageManager
Parameters:
user - the user performing the task. May be null, in which case a more generic notification will be displayed
i18nMessage - the i18n key of the message being performed.

clear

public void clear()
Description copied from interface: ReindexMessageManager
Clears any current message.

Specified by:
clear in interface ReindexMessageManager

getMessage

public String getMessage(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: ReindexMessageManager
Get current message localised for given user.

Specified by:
getMessage in interface ReindexMessageManager
Parameters:
user - the current user
Returns:
the current message, localised for the current user, presented in HTML (and already escaped). null if there is no current message.

getMessageObject

public ReindexMessage getMessageObject()
Description copied from interface: ReindexMessageManager
Get current message object for given user.

Specified by:
getMessageObject in interface ReindexMessageManager
Returns:
the current message data.

clearMessageForTimestamp

public void clearMessageForTimestamp(Date time)
Description copied from interface: ReindexMessageManager
Clears message if it was posted before a specific time

Specified by:
clearMessageForTimestamp in interface ReindexMessageManager
Parameters:
time - If the message was posted before this time it will be cleared.


Copyright © 2002-2014 Atlassian. All Rights Reserved.