1 package com.atlassian.sal.api.license;
2
3 import com.atlassian.annotations.PublicApi;
4
5 import javax.annotation.Nonnull;
6 import javax.annotation.Nullable;
7 import java.util.Date;
8
9 /**
10 * Common license properties that appear in all the different kind of Product Licenses that may occur in Atlassian
11 * applications.
12 *
13 * This interface must not contain properties which may have multiple values in Multi-Product Platform licenses
14 * (eg NumberOfUsers).
15 */
16 @SuppressWarnings("UnusedDeclaration")
17 @PublicApi
18 public interface BaseLicenseDetails {
19 /**
20 * Returns true if this is an evaluation license.
21 *
22 * @return true if this is an evaluation license.
23 * @see #getLicenseTypeName()
24 */
25 boolean isEvaluationLicense();
26
27 /**
28 * Returns the license type name exactly as it appears in the license.
29 *
30 * @return the license type name exactly as it appears in the license.
31 * @see #isEvaluationLicense()
32 */
33 @Nonnull
34 String getLicenseTypeName();
35
36 /**
37 * Returns the Organisation Name.
38 *
39 * @return the Organisation Name.
40 */
41 String getOrganisationName();
42
43 /**
44 * Returns the Support Entitlement Number (SEN) for this license.
45 * <p>
46 * This should only return null for Development licenses.
47 *
48 * @return the Support Entitlement Number (SEN) for this license.
49 */
50 @Nullable
51 String getSupportEntitlementNumber();
52
53 /**
54 * Returns the description that appears in the license.
55 *
56 * @return the description that appears in the license.
57 */
58 String getDescription();
59
60 /**
61 * Returns the Server-ID as it appears in this license.
62 *
63 * @return the Server-ID as it appears in this license.
64 */
65 String getServerId();
66
67 /**
68 * Returns true if this license never expires.
69 * <p>
70 * This is equivalent to calling:
71 * <pre> getLicenseExpiryDate() == null</pre>
72 * </p>
73 *
74 * @return true if this license never expires.
75 */
76 boolean isPerpetualLicense();
77
78 /**
79 * Returns the license expiry date.
80 * <p>
81 * Perpetual licenses will never expire and will return a null expiry date.<br>
82 * Subscription licenses will have an expiry date.<br>
83 * It is recommended that you display the expiry date to users for subscription licenses, and the maintenance
84 * expiry date to users for perpetual licenses.
85 * </p>
86 *
87 * @return the license expiry date or null if this is a perpetual license.
88 * @see #isPerpetualLicense()
89 * @see #getMaintenanceExpiryDate()
90 */
91 @Nullable
92 Date getLicenseExpiryDate();
93
94 /**
95 * Returns the Maintenance expiry date.
96 * That is, the date up until which the customer can receive support.
97 *
98 * @return the Maintenance expiry date.
99 */
100 @Nullable
101 Date getMaintenanceExpiryDate();
102
103 /**
104 * Returns true if this is a "Data Center" license.
105 *
106 * @return true if this is a "Data Center" license.
107 */
108 boolean isDataCenter();
109
110 /**
111 * Returns true if this is an "Enterprise Licensing Agreement" license.
112 *
113 * @return true if this is an "Enterprise Licensing Agreement" license.
114 */
115 boolean isEnterpriseLicensingAgreement();
116
117 /**
118 * Retrieves an arbitrary property from the license.
119 *
120 * @param key the property key
121 * @return the value of the given property in the license.
122 */
123 @Nullable
124 String getProperty(@Nonnull String key);
125 }