Package de.xima.fc.mdl.license
Class LicenseModel
- java.lang.Object
-
- de.xima.fc.mdl.license.LicenseModel
-
- All Implemented Interfaces:
Serializable
public class LicenseModel extends Object implements Serializable
Model to access an license based on there file-data- Author:
- XIMA MEDIA GmbH, Dresden
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LicenseModel(byte[] licenseFileData)
LicenseModel(byte[] licenseFileData, List<byte[]> subLicensesFileData)
-
Method Summary
-
-
-
Constructor Detail
-
LicenseModel
public LicenseModel(byte[] licenseFileData)
- Parameters:
licenseFileData
- the license-file
-
LicenseModel
public LicenseModel(byte[] licenseFileData, List<byte[]> subLicensesFileData)
- Parameters:
licenseFileData
- the license-filesubLicensesFileData
- list of sub-license files
-
-
Method Detail
-
getProcessingLicenseKey
public static String getProcessingLicenseKey(EWorkflowNodeType workflowNodeType)
-
getTriggerLicenseKey
public static String getTriggerLicenseKey(EWorkflowTriggerType workflowTriggerType)
-
getLicense
public javax0.license3j.License getLicense()
Initializes the license (if needed) and returns them- Returns:
- the license
-
getLicenseFileData
public byte[] getLicenseFileData()
The license binary- Returns:
- the binary data of the license
-
isSkipHardwareIdCheck
public boolean isSkipHardwareIdCheck()
- Returns:
true
to skip the hardware check and allow all hardware IDs,false
to perform the hardware ID check. May be useful for development and testing.
-
isSubLicense
public boolean isSubLicense()
- Returns:
true
if the license is an sub-license,false
otherwise
-
isLicenseOK
public boolean isLicenseOK()
- Returns:
true
if the license-file is ok,false
otherwise
-
isDemoLicense
public boolean isDemoLicense()
- Returns:
true
if the license is an demo,false
otherwise
-
isMaintenanceExpired
public boolean isMaintenanceExpired()
- Returns:
true
if the maintenance-period is expired,false
otherwise
-
isExpired
public boolean isExpired()
- Returns:
true
if the license is expired,false
otherwise
-
getLicenseKey
public String getLicenseKey()
- Returns:
- the license key or
null
-
getHardwareIds
public String[] getHardwareIds()
- Returns:
- the array of hardware-ids
-
getLicenseName
public String getLicenseName()
- Returns:
- the name of the license
-
getLicenseMappingName
public String getLicenseMappingName()
- Returns:
- the mapping name of the licnese
-
getVersionKey
public String getVersionKey()
- Returns:
- the key of the license version
-
getParentLicenseKey
public String getParentLicenseKey()
- Returns:
- the key of the parent license
-
getProductKey
public String getProductKey()
- Returns:
- the key of the product
-
getProductName
public String getProductName()
- Returns:
- the name of the product
-
getProductVersion
public String getProductVersion()
- Returns:
- the version of the product
-
getUserFullName
public String getUserFullName()
- Returns:
- the name of the license user
-
getUserEMail
public String getUserEMail()
- Returns:
- the email of the license user
-
getUserCompanyName
public String getUserCompanyName()
- Returns:
- the name of the company
-
getProfContactName
public String getProfContactName()
- Returns:
- the name of the professional contact
-
getProfContactMail
public String getProfContactMail()
- Returns:
- the mail of the professional contact
-
getProfContactPhone
public String getProfContactPhone()
- Returns:
- the phone number of the professional contact
-
getTechContactPhone
public String getTechContactPhone()
- Returns:
- the phone number of the technical contact
-
getTechContactName
public String getTechContactName()
- Returns:
- the name of the technical contact
-
getTechContactMail
public String getTechContactMail()
- Returns:
- the mail of the technical contact
-
getUserTelNumber
public String getUserTelNumber()
- Returns:
- the phone number of the user
-
getLicenseCreationDate
public LocalDateTime getLicenseCreationDate()
- Returns:
- the creation date of the license
-
getLicenseModificationDate
public LocalDateTime getLicenseModificationDate()
- Returns:
- the modification date of the license
-
getLicenseExpireDate
public LocalDateTime getLicenseExpireDate()
- Returns:
- the expire date of the license
-
getMaintenanceExpireDate
public LocalDateTime getMaintenanceExpireDate()
- Returns:
- the maintenance expire date of the license
-
getSubLicenseFeaturesMap
public Map<String,List<IItemLicenseModel>> getSubLicenseFeaturesMap()
-
getRawData
public String getRawData()
-
isValidLicense
public boolean isValidLicense(String parentKey)
- Parameters:
parentKey
- the parent-key to check- Returns:
true
if the license is valid,false
otherwise
-
getLicenseStatus
public ELicenseState getLicenseStatus(String parentKey)
Checks the license state- Parameters:
parentKey
- the parent-key to check- Returns:
- the license state
-
hasFeature
public boolean hasFeature(ELicenseFeature feature)
- Parameters:
feature
-ELicenseFeature
the feature to check- Returns:
true
if the feature is defined,false
otherwise
-
hasFeature
public boolean hasFeature(String featureName)
- Parameters:
featureName
- the name of the feature to check- Returns:
true
if the feature is defined,false
otherwise
-
getString
public String getString(ELicenseFeature feature)
- Parameters:
feature
- the feature to get- Returns:
- the value
-
getBoolean
public boolean getBoolean(ELicenseFeature feature)
- Parameters:
feature
- the feature to get- Returns:
- the value
-
getNumber
public Number getNumber(ELicenseFeature feature)
- Parameters:
feature
- the feature to get- Returns:
- the value
-
getDate
public LocalDateTime getDate(ELicenseFeature feature)
- Parameters:
feature
- the feature to get- Returns:
- the value
-
getString
public String getString(ELicenseFeature feature, String defaultValue)
- Parameters:
feature
- the feature to getdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value
-
getBoolean
public boolean getBoolean(ELicenseFeature feature, boolean defaultValue)
- Parameters:
feature
- the feature to getdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value
-
getNumber
public Number getNumber(ELicenseFeature feature, Number defaultValue)
- Parameters:
feature
- the feature to getdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value
-
getDate
public LocalDateTime getDate(ELicenseFeature feature, LocalDateTime defaultValue)
- Parameters:
feature
- the feature to getdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value
-
isValid
public boolean isValid(ELicenseFeature feature)
- Parameters:
feature
- the feature to check- Returns:
true
if the feature is valid,false
otherwise
-
isValid
public boolean isValid(String featureName)
- Parameters:
featureName
- the name of the feature to check- Returns:
true
if the feature is valid,false
otherwise
-
getExpireDate
public LocalDateTime getExpireDate(ELicenseFeature feature)
- Parameters:
feature
- the feature to get the expire date of- Returns:
- the expire date of the feature or
null
-
getExpireDate
public LocalDateTime getExpireDate(String featureName)
- Parameters:
featureName
- the name of the feature to get the expire date of- Returns:
- the expire date of the feature or
null
-
getComment
public String getComment(ELicenseFeature feature)
- Parameters:
feature
- the feature to get the comment of- Returns:
- the comment of the feature or
null
-
getComment
public String getComment(String featureName)
- Parameters:
featureName
- the name of the feature to get the comment of- Returns:
- the comment of the feature or
null
-
getDate
public LocalDateTime getDate(String featureName)
- Parameters:
featureName
- the name of the feature to get the date value from- Returns:
- the date value of the feature or
null
-
getDate
public LocalDateTime getDate(String featureName, LocalDateTime defaultValue)
- Parameters:
featureName
- the name of the feature to get the date value fromdefaultValue
- the default value to return if the feature is not defined- Returns:
- the date value of the feature or the default value
-
getString
public String getString(String featureName)
- Parameters:
featureName
- the name of the feature to get the string value from- Returns:
- the string value of the feature or
null
-
getString
public String getString(String featureName, String defaultValue)
- Parameters:
featureName
- the name of the feature to get the string value fromdefaultValue
- the default value to return if the feature is not defined- Returns:
- the string value of the feature or the default value
-
getBoolean
public boolean getBoolean(String featureName)
- Parameters:
featureName
- the name of the feature to get the boolean value from- Returns:
- the boolean value of the feature or
null
-
getBoolean
public boolean getBoolean(String featureName, boolean defaultValue)
- Parameters:
featureName
- the name of the feature to get the boolean value fromdefaultValue
- the default value to return if the feature is not defined- Returns:
- the boolean value of the feature or the default value
-
getNumber
public Number getNumber(String featureName)
- Parameters:
featureName
- the name of the feature to get the string value from- Returns:
- the number value of the feature or 0
-
-