@PublicApi public interface

LicenseCountService

com.atlassian.jira.license.LicenseCountService
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

Provides various counts of users in JIRA. Implementations are expected to cache the results of methods to ensure that count look-ups are fast.

Summary

Public Methods
void flush()
This method is deprecated. use flushBillableUsersCache(). Since v7.0. Eventually we want to remove this method in favour of the one with a more descriptive name.
void flushBillableUsersCache()
Clear the cache for billable users.
int totalBillableUsers()
Gets the number of active users who currently count towards the license and should be charged for.

Public Methods

public void flush ()

This method is deprecated.
use flushBillableUsersCache(). Since v7.0. Eventually we want to remove this method in favour of the one with a more descriptive name.

Clear the billable users cache. Note, despite the general name this clears only the billable users cache. Usually it is not necessary to call this method as implementors are expected to clear cached state in response to appropriate events.

public void flushBillableUsersCache ()

Clear the cache for billable users. Usually it is not necessary to call this method as implementors are expected to clear cached state in response to appropriate events.

public int totalBillableUsers ()

Gets the number of active users who currently count towards the license and should be charged for. This method should be used when determining user counts for billing purposes, such as purchase tier recommendations for plugins, and by plugins who wish to enforce tier-based licenses.

In all cases this method will exclude Connect users from the count. In Cloud this will also exclude users who exist for the purpose of providing support (such as the Atlassian sysadmin user).

Implementations of this method should take performance into consideration, and ensure that the value is cached. Use flush() to clear the cache.

Returns
  • the number of users in JIRA which currently count against at least one license