public class

DefaultLicenseRoleManager

extends Object
implements LicenseRoleManager
java.lang.Object
   ↳ com.atlassian.jira.license.DefaultLicenseRoleManager

Class Overview

Default implementation of LicenseRoleManager.

Summary

Public Constructors
DefaultLicenseRoleManager(LicenseRoleGroupsCache licenseRoleGroupsCache, EntityEngine entityEngine, PluginAccessor pluginAccessor)
Public Methods
@Nonnull Set<LicenseRoleDefinition> getDefinedLicenseRoles()
Returns the Collection of all currently defined LicenseRoleDefinitions.
@Nonnull ImmutableSet<String> getGroupsFor(LicenseRoleId licenseRoleId)
Retrieves the groups for the specified license role.
@Nonnull Optional<LicenseRoleDefinition> getLicenseRoleDefinition(LicenseRoleId licenseRoleId)
Return the LicenseRoleDefinition associated with the passed LicenseRoleId or absent() if it does not exist.
boolean isLicenseRoleDefined(LicenseRoleId licenseRoleId)
Determines whether a provided license role is defined.
boolean licenseRoleHasGroup(LicenseRoleId licenseRoleId, String groupId)
Determines whether a group is associated with a license role.
void setGroups(LicenseRoleId licenseRoleId, Iterable<String> groups)
Set the groups associated with the passed LicenseRoleId.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.license.LicenseRoleManager

Public Constructors

public DefaultLicenseRoleManager (LicenseRoleGroupsCache licenseRoleGroupsCache, EntityEngine entityEngine, PluginAccessor pluginAccessor)

Public Methods

@Nonnull public Set<LicenseRoleDefinition> getDefinedLicenseRoles ()

Returns the Collection of all currently defined LicenseRoleDefinitions. Specifically, this is all LicenseRoleDefinitions that are declared to exist throughout the whole system, even if they do not have a valid license.

Returns

@Nonnull public ImmutableSet<String> getGroupsFor (LicenseRoleId licenseRoleId)

Retrieves the groups for the specified license role.

Parameters
licenseRoleId the license role to retrieve the groups for.
Returns
  • an immutable collection of groups for this license role. Will not be null.

@Nonnull public Optional<LicenseRoleDefinition> getLicenseRoleDefinition (LicenseRoleId licenseRoleId)

Return the LicenseRoleDefinition associated with the passed LicenseRoleId or absent() if it does not exist.

Parameters
licenseRoleId the license role to check for.
Returns
  • the LicenseRoleDefinition associated with the passed LicenseRoleId.

public boolean isLicenseRoleDefined (LicenseRoleId licenseRoleId)

Determines whether a provided license role is defined. Specifically, this will check all LicenseRoleDefinitions that are declared to exist throughout the whole system, even if they do not have a valid license.

Parameters
licenseRoleId the license role to check for.
Returns
  • true when the provided license role is defined and installed.

public boolean licenseRoleHasGroup (LicenseRoleId licenseRoleId, String groupId)

Determines whether a group is associated with a license role.

Parameters
licenseRoleId the license role to check for. Must not be null.
groupId the group to check for. Must not be null.
Returns
  • true when the group belongs to the license role.

public void setGroups (LicenseRoleId licenseRoleId, Iterable<String> groups)

Set the groups associated with the passed LicenseRoleId.

Parameters
licenseRoleId the id of the license role to update.
groups the groups to associated with the passed license role.