com.atlassian.jira.license
Interface LicenseRole

All Known Implementing Classes:
MockLicenseRole

@ExperimentalApi
@Immutable
public interface LicenseRole

Represents a License Role in JIRA.

LicenseRoles exist in one of 3 states: defined, installed, and active:

                                DEFINED
                               --------
                                 |  |\
                                 |  |
                   installation  |  |  uninstallation
                  (add license)  |  |  (remove license)
                                 |  |
                                \|  |
                              ----------
                              INSTALLED
                              ----------
                                 |  |\
                                 |  |
                     activation  |  |  inactivation
           (license is current)  |  |  (license expires or is exceeded)
                                 |  |
                                \|  |
                               --------
                                ACTIVE
 

Note that an active LicenseRole is necessarily also defined and installed, whereas a a defined LicenseRole may or may not be installed or active.

Since:
v6.3

Method Summary
 Set<String> getGroups()
          Return the set of Group Ids associated with the role.
 LicenseRoleId getId()
          Returns the canonical LicenseRoleId that uniquely identifies this LicenseRole.
 String getName()
          Return the name of the license role.
 com.atlassian.fugue.Option<String> getPrimaryGroup()
          Return the primary group configured for the role.
 LicenseRole withGroups(Iterable<String> groups, com.atlassian.fugue.Option<String> primaryGroup)
          Return a new LicenseRole with its groups and primaryGroup set to the passed arguments.
 

Method Detail

getId

@Nonnull
LicenseRoleId getId()
Returns the canonical LicenseRoleId that uniquely identifies this LicenseRole.

Returns:
the canonical LicenseRoleId that uniquely identifies this LicenseRole.

getName

@Nonnull
String getName()
Return the name of the license role. The name is i18ned for the calling user if possible.

Returns:
the name of the license role. The name is i18ned for the calling user if possible.

getGroups

@Nonnull
Set<String> getGroups()
Return the set of Group Ids associated with the role.

Returns:
the groups ids associated with the role.

getPrimaryGroup

@Nonnull
com.atlassian.fugue.Option<String> getPrimaryGroup()
Return the primary group configured for the role. Option.none() may be returned if no primary is configured.

Returns:
the primary group associated with the role.

withGroups

@Nonnull
LicenseRole withGroups(@Nonnull
                               Iterable<String> groups,
                               @Nonnull
                               com.atlassian.fugue.Option<String> primaryGroup)
Return a new LicenseRole with its groups and primaryGroup set to the passed arguments.

Parameters:
groups - the groups associated with the role.
primaryGroup - primary group for the role. A value of Option.none() can be passed indicate that there is no primaryGroup for the role.
Returns:
a new LicenseRole with its groups and primaryGroup set to the passed arguments.
Throws:
IllegalArgumentException - if groups contains null or the primaryGroup is not within groups.


Copyright © 2002-2014 Atlassian. All Rights Reserved.