1 package com.atlassian.sal.api.license;
2
3 import com.atlassian.annotations.PublicApi;
4
5 import javax.annotation.Nonnull;
6
7 /**
8 * Represents license information for an individual role-based "Product" that lives on a platform.
9 */
10 @SuppressWarnings ("UnusedDeclaration")
11 @PublicApi
12 public interface ProductLicense
13 {
14 static final int UNLIMITED_USER_COUNT = -1;
15
16 /**
17 * Returns the product key as it occurs in the license.
18 * <p>eg "com.atlassian.servicedesk", "crucible", "conf"</p>
19 *
20 * @return the product key
21 */
22 @Nonnull
23 String getProductKey();
24
25 /**
26 * Returns true if this license authorises an unlimited number of users.
27 *
28 * @return true if this license authorises an unlimited number of users.
29 *
30 * @see #getNumberOfUsers()
31 */
32 boolean isUnlimitedNumberOfUsers();
33
34 /**
35 * Returns the number of users allowed by the current license.
36 *
37 * @return the number of user allowed by the license, {@link #UNLIMITED_USER_COUNT} if there is no limit
38 *
39 * @see #isUnlimitedNumberOfUsers()
40 */
41 int getNumberOfUsers();
42
43 /**
44 * Returns the "official" product name as it occurs in the license.
45 * <p>
46 * eg "Service Desk"
47 * <p>
48 * You would normally try to extract this name from the plugin itself, but this is included as a fallback in
49 * case the license is installed but the plugin is not.
50 * <p>
51 * The product name is a trademark and is never internationalised.
52 *
53 * @return the "official" product name as it occurs in the license.
54 */
55 @Nonnull
56 String getProductDisplayName();
57 }