com.atlassian.jira.license
Interface LicenseRoleManager

All Known Implementing Classes:
DefaultLicenseRoleManager

@ExperimentalApi
public interface LicenseRoleManager

Provides read and write capabilities regarding LicenseRoles. Unless otherwise stated, the methods on this class only deal with installed LicenseRoles. An installed LicenseRole has been defined by a plugin/product AND has an accompanying license that grants that role.

Since:
6.3

Method Summary
 Set<String> getGroupsForInstalledLicenseRoles()
          Get the Set of group names that have been associated with one or more installed license roles.
 com.atlassian.fugue.Option<LicenseRole> getLicenseRole(LicenseRoleId licenseRoleId)
          Return the installed LicenseRole associated with the passed ID or Option.none() if no such role exists.
 Set<LicenseRole> getLicenseRoles()
          Returns the Set of all currently installed LicenseRoles.
 int getUserCount(LicenseRoleId roleId)
          Retrieve the number of active users for a specific license role (product).
 boolean isLicenseRoleInstalled(LicenseRoleId licenseRoleId)
          Return true when the passed LicenseRoleId is installed.
 void removeGroupFromLicenseRoles(String groupName)
          Removes any/all associations of the given group from all license roles.
 LicenseRole setLicenseRole(LicenseRole role)
          Save the passed LicenseRole information to the database.
 

Method Detail

getLicenseRole

@Nonnull
com.atlassian.fugue.Option<LicenseRole> getLicenseRole(@Nonnull
                                                               LicenseRoleId licenseRoleId)
Return the installed LicenseRole associated with the passed ID or Option.none() if no such role exists. An installed LicenseRole has been defined by a plugin/product AND has an accompanying license that grants that role.

Parameters:
licenseRoleId - the ID to search for.
Returns:
the LicenseRole associated with the passed ID.
Since:
6.4

getLicenseRoles

@Nonnull
Set<LicenseRole> getLicenseRoles()
Returns the Set of all currently installed LicenseRoles. An installed LicenseRole has been defined by a plugin/product AND has an accompanying license that grants that role.

Returns:
the Set of installed LicenseRoles.
Since:
6.4

getGroupsForInstalledLicenseRoles

@Nonnull
Set<String> getGroupsForInstalledLicenseRoles()
Get the Set of group names that have been associated with one or more installed license roles. An installed LicenseRole has been defined by a plugin/product AND has an accompanying license that grants that role.

Returns:
groups associated with all installed license roles
Since:
6.4
See Also:
LicenseRoleAdminService

removeGroupFromLicenseRoles

void removeGroupFromLicenseRoles(@Nonnull
                                 String groupName)
Removes any/all associations of the given group from all license roles.

Parameters:
groupName - the name of the group to remove.
Since:
6.4

isLicenseRoleInstalled

boolean isLicenseRoleInstalled(@Nonnull
                               LicenseRoleId licenseRoleId)
Return true when the passed LicenseRoleId is installed. An installed LicenseRole has been defined by a plugin/product AND has an accompanying license that grants that role.

Parameters:
licenseRoleId - the ID to check.
Returns:
true when the passed LicenseRoleId is installed.

setLicenseRole

@Nonnull
LicenseRole setLicenseRole(@Nonnull
                                   LicenseRole role)
Save the passed LicenseRole information to the database. This method will only accept the passed role if:
  1. The role is active, that is, it is defined by a product/plugin and has an accompanying license that is current.
  2. The role only contains currently valid groups.
  3. The primary group is contained within the role.

Parameters:
role - the role to save.
Returns:
the role as persisted to the database.
Throws:
IllegalArgumentException - if passed role does not contain valid groups, if the primary group is invalid or if the role is not installed.
Since:
6.4

getUserCount

int getUserCount(@Nonnull
                 LicenseRoleId roleId)
Retrieve the number of active users for a specific license role (product). It will uniquely count all users who are found in the groups associated with the product.

Parameters:
roleId - is the license role ID used to identify the product.
Returns:
the number of active users for the product identified by roleId
Since:
6.4


Copyright © 2002-2015 Atlassian. All Rights Reserved.