Package de.xima.fc.license
Class LicenseAccess
java.lang.Object
de.xima.fc.license.LicenseAccess
Model that combines a system and a client license. When querying a
feature
, first it checks
whether that feature exists in the client license. If not, it falls back to the system license. Otherwise, an
appropriate default value is returned.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH, Dresden
-
Constructor Summary
ConstructorsConstructorDescriptionLicenseAccess
(LicenseModel systemLicense) LicenseAccess
(LicenseModel systemLicense, LicenseModel clientLicense) Creates a new license wrapper with a client and system license. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBooleanFeature
(ELicenseFeature feature) boolean
getBooleanFeature
(ELicenseFeature feature, boolean defaultValue) boolean
getBooleanFeature
(String featureName, boolean defaultValue) Gets the clientLicensegetNumberFeature
(ELicenseFeature feature) getNumberFeature
(ELicenseFeature feature, Number defaultValue) getNumberFeature
(String featureName, Number defaultValue) getStringFeature
(ELicenseFeature feature) getStringFeature
(ELicenseFeature feature, String defaultValue) getStringFeature
(String featureName, String defaultValue) int
getSublicenseCount
(String subLicenseItemKey) getSubLicensesByItem
(String subLicenseItemKey) Gets the systemLicenseboolean
hasAccess
(EAccessProperty property) boolean
hasSublicense
(String subLicenseItemKey) boolean
boolean
-
Constructor Details
-
LicenseAccess
- Parameters:
systemLicense
- the system license
-
LicenseAccess
Creates a new license wrapper with a client and system license. When querying a feature, first it tries the client license, then the system license.- Parameters:
systemLicense
- The system license, may benull
(which is treated as an empty license without any features).clientLicense
- The client license, may benull
(which is treated as an empty license without any features).
-
-
Method Details
-
getBooleanFeature
- Parameters:
feature
- the feature to get the value of- Returns:
- the value of the feature,
false
if the feature is not defined
-
getBooleanFeature
- Parameters:
feature
- the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value of the feature or the defaultValue if the feature is not defined
-
getBooleanFeature
- Parameters:
featureName
- the name of the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value of the feature or the defaultValue if the feature is not defined
-
getClientLicense
Gets the clientLicense- Returns:
- the clientLicense
-
getNumberFeature
- Parameters:
feature
- the feature to get the value of- Returns:
- the value of the feature, 0 if the feature is not defined
-
getNumberFeature
- Parameters:
feature
- the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- The value of the feature or the default value if the feature is not defined
-
getNumberFeature
- Parameters:
featureName
- the name of the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value of the feature or the defaultValue if the feature is not defined
-
getStringFeature
- Parameters:
feature
- the feature to get the value of- Returns:
- the value of the feature, empty string if the feature does not exist.
-
getStringFeature
- Parameters:
feature
- the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value of the feature or the defaultValue if the feature does not exist.
-
getStringFeature
- Parameters:
featureName
- the name of the feature to get the value ofdefaultValue
- the default value to return if the feature is not defined- Returns:
- the value of the feature or the defaultValue if the feature is not defined
-
getSystemLicense
Gets the systemLicense- Returns:
- the systemLicense
-
hasAccess
- Parameters:
property
- theEAccessProperty
to check- Returns:
- the value of the
EAccessProperty
in the license ortrue
if theEAccessProperty
is not defined
-
getSubLicensesByItem
-
hasSublicense
-
getSublicenseCount
-
isClientLicenseValid
public boolean isClientLicenseValid()- Returns:
true
if the combination of client and system license is valid,false
otherwise
-
isSystemLicenseValid
public boolean isSystemLicenseValid()- Returns:
true
if the system license is valid,false
otherwise
-