@PublicApi public interface

FlagDismissalService

com.atlassian.jira.user.flag.FlagDismissalService
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Keeps a record of notification flags dismissed per-user, and provides a means to clear dismissals for a given flag for all users.

This is achieved by storing the time of dismissal and the reset time for a flag, and the latest one takes precedence.

Summary

Public Methods
void dismissFlagForUser(String flagKey, ApplicationUser user)
Set<String> getDismissedFlagsForUser(ApplicationUser user)
void removeDismissFlagForUser(String flagKey, ApplicationUser user)
Remove the dismiss entry for the current user.
void resetFlagDismissals(String flagKey)

Public Methods

public void dismissFlagForUser (String flagKey, ApplicationUser user)

Parameters
flagKey An arbitrary identifier for a given flag
user The user dismissing the flag

public Set<String> getDismissedFlagsForUser (ApplicationUser user)

Parameters
user The user for whom we wish to see dismissed flags
Returns
  • The list of flags the user has dismissed since they were last reset

public void removeDismissFlagForUser (String flagKey, ApplicationUser user)

Remove the dismiss entry for the current user. Removing a dismiss entry means that it is no longer considered hidden by the user.

Parameters
flagKey An arbitrary identifier for a given flag
user The user to remove the flag for

public void resetFlagDismissals (String flagKey)

Parameters
flagKey The flag to start showing everyone again