View Javadoc

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