com.atlassian.extras.api
Interface ProductLicense

All Known Subinterfaces:
BambooLicense, CloverLicense, ConfluenceLicense, CrowdLicense, CrucibleLicense, FisheyeLicense, GreenHopperLicense, JiraLicense, PluginLicense, StashLicense

public interface ProductLicense

Defines the license for a single instance of a single product.


Method Summary
 java.util.Collection<Contact> getContacts()
           
 java.util.Date getCreationDate()
           
 java.lang.String getDescription()
          User friendly description of this license
 java.util.Date getExpiryDate()
           
 java.util.Date getGracePeriodEndDate()
          Returns the expiry date of the grace period.
 LicenseType getLicenseType()
           
 int getLicenseVersion()
          The version of the license (i.e.
 java.util.Date getMaintenanceExpiryDate()
           
 int getMaximumNumberOfUsers()
           
 int getNumberOfDaysBeforeExpiry()
          Returns the number of days before license expires.
 int getNumberOfDaysBeforeGracePeriodExpiry()
          Returns the number of day before the grace period expires.
 int getNumberOfDaysBeforeMaintenanceExpiry()
          Returns the number of days before the maintenance expires.
 Organisation getOrganisation()
           
 Partner getPartner()
           
 Product getProduct()
          Returns the product to which this license is associated to.
 java.lang.Iterable<Product> getProducts()
          Returns all Products which are associated with this license.
 java.lang.String getProperty(java.lang.String name)
           
 java.util.Date getPurchaseDate()
           
 java.lang.String getServerId()
           
 java.lang.String getSupportEntitlementNumber()
           
 boolean isClusteringEnabled()
           
 boolean isEvaluation()
           
 boolean isExpired()
           
 boolean isGracePeriodExpired()
           
 boolean isMaintenanceExpired()
           
 boolean isSubscription()
           
 boolean isUnlimitedNumberOfUsers()
           
 boolean isWithinGracePeriod()
          Tells whether now is after the expiry date and before the grace period end date.
 

Method Detail

getLicenseVersion

int getLicenseVersion()
The version of the license (i.e. which encoder was used to encode the license String), 0 if none set.


getDescription

java.lang.String getDescription()
User friendly description of this license


getProduct

Product getProduct()
Returns the product to which this license is associated to. If additional licenses are embedded, please use getProducts(). In this case, getProduct() will return just the host application Product but not the embedded ones.

Returns:
the product to which this license is associated to.
See Also:
getProducts()

getProducts

java.lang.Iterable<Product> getProducts()
Returns all Products which are associated with this license. This can be any number of Products due to being able to embed additional products (e.g. OnDemand plugins) into a host license.

Returns:
all Products which are associated with this license.
Since:
3.1.1
See Also:
getProduct()

getServerId

java.lang.String getServerId()
Returns:
the server id associated with this license.

getPartner

Partner getPartner()
Returns:
the partner associated to this license, null if none.

getOrganisation

Organisation getOrganisation()
Returns:
the organisation that bought the license.

getContacts

java.util.Collection<Contact> getContacts()
Returns:
the list of contacts in the Organisation for this license.

getCreationDate

java.util.Date getCreationDate()
Returns:
the date the license was created

getPurchaseDate

java.util.Date getPurchaseDate()
Returns:
the date the license was purchased.

getExpiryDate

java.util.Date getExpiryDate()
Returns:
the license expiry date, null if the license never expires.

getNumberOfDaysBeforeExpiry

int getNumberOfDaysBeforeExpiry()
Returns the number of days before license expires. This method should not be used to determine whether the license has expired as it is only accurate down to a day. Use isExpired() instead.

Returns:
the number of days before expiry, Integer.MAX_VALUE if the license never expires.
See Also:
isExpired(), getNumberOfDaysBeforeMaintenanceExpiry()

isExpired

boolean isExpired()
Returns:
true if the license is expired, false otherwise.
See Also:
getExpiryDate()

getGracePeriodEndDate

java.util.Date getGracePeriodEndDate()

Returns the expiry date of the grace period. The grace period extends from the expiry date to the date returned by this method. This period is typically used to alert customers that their license has expired but they will still work fully for some period of time.

If the license doesn't expire then this method will return null, just as getExpiryDate().

Returns:
the date at which the grace period ends, null if the license never expires.
See Also:
getExpiryDate()

getNumberOfDaysBeforeGracePeriodExpiry

int getNumberOfDaysBeforeGracePeriodExpiry()

Returns the number of day before the grace period expires. This method should not be used to determine whether the grace period has ended as it is only accurate down to a day. Use {#isGracePeriodExpired()} instead.

If the license doesn't expire (no need for grace period expiry) it will return Integer.MAX_VALUE.

This method will return a valid number of days otherwise, even if the license hasn't expired yet and the grace period still hasn't been activated. Users should use {#isWithinGracePeriod()} to check whether the grace period has been activated

Returns:
the number of days before the grace period expires.

isWithinGracePeriod

boolean isWithinGracePeriod()
Tells whether now is after the expiry date and before the grace period end date. This method will always return false for licenses that don't expire.

Returns:
true if now is between the two dates mentionned, false otherwise.
See Also:
getGracePeriodEndDate(), getExpiryDate()

isGracePeriodExpired

boolean isGracePeriodExpired()
Returns:
true if the license is past the grace period end date, false if it is null or the license is not past the grace period end date.
See Also:
getGracePeriodEndDate()

getSupportEntitlementNumber

java.lang.String getSupportEntitlementNumber()
Returns:
the Support Entitlement Number (SEN), null if it cannot be found in the license.

getMaintenanceExpiryDate

java.util.Date getMaintenanceExpiryDate()
Returns:
the expiry date for the maintenance on this license, null if the maintenance never expires.

getNumberOfDaysBeforeMaintenanceExpiry

int getNumberOfDaysBeforeMaintenanceExpiry()
Returns the number of days before the maintenance expires. This method should not be used to determine whether the maintenance has expired or not as it is only accurate down to a day. Use isMaintenanceExpired() instead.

Returns:
the number of days before maintenance expriy, Integer.MAX_VALUE if the maintenance never expires.
See Also:
isMaintenanceExpired(), getNumberOfDaysBeforeExpiry()

isMaintenanceExpired

boolean isMaintenanceExpired()
Returns:
true if the maintenance for this license is expired, false otherwise.
See Also:
getMaintenanceExpiryDate()

getMaximumNumberOfUsers

int getMaximumNumberOfUsers()
Returns:
the maximum number of users allowed for this product instance, -1 if unlimited.
See Also:
isUnlimitedNumberOfUsers()

isUnlimitedNumberOfUsers

boolean isUnlimitedNumberOfUsers()
Returns:
true if the license is for unlimited number of users, false otherwise.
See Also:
getMaximumNumberOfUsers()

isEvaluation

boolean isEvaluation()
Returns:
true if this is an evaluation license, false otherwise.

isSubscription

boolean isSubscription()
Returns:
true if this is a subscription license, false otherwise.

isClusteringEnabled

boolean isClusteringEnabled()
Returns:
true if this is a clustering license, false otherwise.
Since:
3.2

getLicenseType

LicenseType getLicenseType()
Returns:
the license type.

getProperty

java.lang.String getProperty(java.lang.String name)
Parameters:
name - the name of the property to look for
Returns:
the property from the license, null if the property doesn't exist.


Copyright © 2005-2014 Atlassian. All Rights Reserved.