public class License extends Object
Modifier and Type | Method and Description |
---|---|
ActivationExecutor |
createActivationExecutor()
Creates an executor to activate keys embedded in this license.
|
List<String> |
getActivationKeys()
Returns the keys embedded in the license that can be activated.
|
Optional<Integer> |
getDaysBeforeExpiration()
Determines the number of days before the license is expiring.
|
Optional<Date> |
getExpirationDate()
Returns the date at which the license is expiring, if any.
|
Optional<String> |
getHostName()
Returns the host name this license is restricted to, if any.
|
Map<String,String> |
getProperties()
Returns the custom key/value pairs stored in the license.
|
Optional<Date> |
getStartDate()
Returns the date at which the license becomes valid, if any.
|
boolean |
isExpired()
Determines whether the license is expired, i.e.
|
static License |
read(InputStream licenseContent)
Reads license information from the specified stream.
|
public static License read(InputStream licenseContent) throws ActivationException
licenseContent
- the content of a license.ActivationException
- if the license cannot be read (e.g. content was tampered).public Optional<String> getHostName()
Optional.empty()
is none.public Optional<Date> getStartDate()
Optional.empty()
is none.isExpired()
public Optional<Date> getExpirationDate()
Optional.empty()
is none.isExpired()
public boolean isExpired()
true
if the license is yet expired, false
otherwise.getDaysBeforeExpiration()
,
getExpirationDate()
public Optional<Integer> getDaysBeforeExpiration()
Optional.empty()
if it has no expiration date.getExpirationDate()
public List<String> getActivationKeys()
createActivationExecutor()
public Map<String,String> getProperties()
public ActivationExecutor createActivationExecutor()