@ExperimentalApi public interface

LicenseRoleManager

com.atlassian.jira.license.LicenseRoleManager
Known Indirect Subclasses

@ExperimentalApi

This interface is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

Provides read and write capabilities regarding license roles.

Summary

Public Methods
@Nonnull Set<LicenseRoleDefinition> getDefinedLicenseRoles()
Returns the Collection of all currently defined LicenseRoleDefinitions.
@Nonnull Set<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.

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 Set<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.