1 package com.atlassian.sal.api.license;
2
3 import com.atlassian.annotations.PublicApi;
4
5 import java.util.Date;
6 import javax.annotation.Nonnull;
7 import javax.annotation.Nullable;
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 /**
21 * Returns true if this is an evaluation license.
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 * @return the license type name exactly as it appears in the license.
30 * @see #isEvaluationLicense()
31 */
32 @Nonnull
33 String getLicenseTypeName();
34
35 /**
36 * Returns the Organisation Name.
37 * @return the Organisation Name.
38 */
39 String getOrganisationName();
40
41 /**
42 * Returns the Support Entitlement Number (SEN) for this license.
43 * <p>
44 * This should only return null for Development licenses.
45 *
46 * @return the Support Entitlement Number (SEN) for this license.
47 */
48 @Nullable
49 String getSupportEntitlementNumber();
50
51 /**
52 * Returns the description that appears in the license.
53 * @return the description that appears in the license.
54 */
55 String getDescription();
56
57 /**
58 * Returns the Server-ID as it appears in this license.
59 * @return the Server-ID as it appears in this license.
60 */
61 String getServerId();
62
63 /**
64 * Returns true if this license never expires.
65 * <p>
66 * This is equivalent to calling:
67 * <pre> getLicenseExpiryDate() == null</pre>
68 * </p>
69 *
70 * @return true if this license never expires.
71 */
72 boolean isPerpetualLicense();
73
74 /**
75 * Returns the license expiry date.
76 * <p>
77 * Perpetual licenses will never expire and will return a null expiry date.<br>
78 * Subscription licenses will have an expiry date.<br>
79 * It is recommended that you display the expiry date to users for subscription licenses, and the maintenance
80 * expiry date to users for perpetual licenses.
81 * </p>
82 *
83 * @return the license expiry date or null if this is a perpetual license.
84 *
85 * @see #isPerpetualLicense()
86 * @see #getMaintenanceExpiryDate()
87 */
88 @Nullable
89 Date getLicenseExpiryDate();
90
91 /**
92 * Returns the Maintenance expiry date.
93 * That is, the date up until which the customer can receive support.
94 * @return the Maintenance expiry date.
95 */
96 @Nullable
97 Date getMaintenanceExpiryDate();
98
99 /**
100 * Returns true if this is a "Data Center" license.
101 * @return true if this is a "Data Center" license.
102 */
103 boolean isDataCenter();
104
105 /**
106 * Returns true if this is an "Enterprise Licensing Agreement" license.
107 * @return true if this is an "Enterprise Licensing Agreement" license.
108 */
109 boolean isEnterpriseLicensingAgreement();
110
111 /**
112 * Retrieves an arbitrary property from the license.
113 *
114 * @param key the property key
115 * @return the value of the given property in the license.
116 */
117 @Nullable
118 String getProperty(@Nonnull String key);
119 }