View Javadoc
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   * <p>
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       *
73       * @return true if this license never expires.
74       */
75      boolean isPerpetualLicense();
76  
77      /**
78       * Returns the license expiry date.
79       * <p>
80       * Perpetual licenses will never expire and will return a null expiry date.<br>
81       * Subscription licenses will have an expiry date.<br>
82       * It is recommended that you display the expiry date to users for subscription licenses, and the maintenance
83       * expiry date to users for perpetual licenses.
84       * </p>
85       *
86       * @return the license expiry date or null if this is a perpetual license.
87       * @see #isPerpetualLicense()
88       * @see #getMaintenanceExpiryDate()
89       */
90      @Nullable
91      Date getLicenseExpiryDate();
92  
93      /**
94       * Returns the Maintenance expiry date.
95       * That is, the date up until which the customer can receive support.
96       *
97       * @return the Maintenance expiry date.
98       */
99      @Nullable
100     Date getMaintenanceExpiryDate();
101 
102     /**
103      * Returns true if this is a "Data Center" license.
104      *
105      * @return true if this is a "Data Center" license.
106      */
107     boolean isDataCenter();
108 
109     /**
110      * Returns true if this is an "Enterprise Licensing Agreement" license.
111      *
112      * @return true if this is an "Enterprise Licensing Agreement" license.
113      */
114     boolean isEnterpriseLicensingAgreement();
115 
116     /**
117      * Retrieves an arbitrary property from the license.
118      *
119      * @param key the property key
120      * @return the value of the given property in the license.
121      */
122     @Nullable
123     String getProperty(@Nonnull String key);
124 }