com.atlassian.jira.license
Class DefaultLicenseRoleDetails

java.lang.Object
  extended by com.atlassian.jira.license.DefaultLicenseRoleDetails
All Implemented Interfaces:
LicenseRoleDetails

@ExperimentalApi
public class DefaultLicenseRoleDetails
extends Object
implements LicenseRoleDetails

Default implementation of LicenseRoleDetails.

This implementation fails fast (in the constructor) on detection of invalid license or license role details.

Since:
v6.3

Field Summary
 
Fields inherited from interface com.atlassian.jira.license.LicenseRoleDetails
UNLIMITED_USERS
 
Constructor Summary
DefaultLicenseRoleDetails(String license, com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder)
           
 
Method Summary
 Set<LicenseRoleId> getLicenseRoles()
          Returns the license roles encoded in the present license.
 int getUserLimit(LicenseRoleId role)
          Returns the number of seats for the given LicenseRoleId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLicenseRoleDetails

public DefaultLicenseRoleDetails(@Nonnull
                                 String license,
                                 @Nonnull
                                 com.atlassian.extras.decoder.api.LicenseDecoder licenseDecoder)
                          throws com.atlassian.extras.common.LicenseException
Parameters:
license - An encoded license string.
licenseDecoder - A license decoder capable of decoding the given license.
Throws:
com.atlassian.extras.common.LicenseException - on detection of invalid roles or role user counts.
Method Detail

getLicenseRoles

@Nonnull
public Set<LicenseRoleId> getLicenseRoles()
Returns the license roles encoded in the present license. Note: This implementation returns an unmodifiable Set.

Specified by:
getLicenseRoles in interface LicenseRoleDetails

getUserLimit

public int getUserLimit(@Nonnull
                        LicenseRoleId role)
Description copied from interface: LicenseRoleDetails
Returns the number of seats for the given LicenseRoleId.

Specified by:
getUserLimit in interface LicenseRoleDetails
Returns:
the number of users/seats for the given license role; see also LicenseRoleDetails.UNLIMITED_USERS.


Copyright © 2002-2014 Atlassian. All Rights Reserved.