|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jp.protection.pub.LicenseBaseImpl
com.jp.protection.pub.LicenseImpl
public class LicenseImpl
This class represents default implementation of the License interface.
| Field Summary | |
|---|---|
protected static java.text.DateFormat |
DATE_FORMAT
|
protected java.lang.String |
fLicenseLocation
|
protected int |
fLicenseState
|
protected java.lang.String |
fLicenseText
|
protected java.util.HashMap |
fProductFeaturesMap
|
protected java.util.HashMap |
fProperties
|
static long |
serialVersionUID
|
static java.lang.String |
TYPE_STR_COMMERCIAL
|
static java.lang.String |
TYPE_STR_EVALUATION
|
static java.lang.String |
TYPE_STR_EXTENDED_EVALUATION
|
static java.lang.String |
USER_LICENSING_FLOATING_LS_STR
|
static java.lang.String |
USER_LICENSING_FLOATING_STR
|
static java.lang.String |
USER_LICENSING_NAMED_LS_STR
|
static java.lang.String |
USER_LICENSING_NAMED_STR
|
static java.lang.String |
USER_LICENSING_UNCOUNTED_STR
|
static java.lang.String |
USER_LICENSING_UNKNOWN_STR
|
| Fields inherited from class com.jp.protection.pub.LicenseBaseImpl |
|---|
fGracePeriod, fLicenseExpireDate, fLicenseIssueDate, fLicenseNumber, fLicenseOptions, fLicenseType, fNumberCopies, fProduct, fProductEdition, fProductMajorVersion, fProductMinorVersion, fUserLicensingModel |
| Constructor Summary | |
|---|---|
LicenseImpl()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
int |
getActivationGracePeriod()
Returns activation grace period (in days) for the license |
java.lang.String |
getActivationKey()
Returns activation key of the license |
static java.lang.String |
getActivationTypeStr(int anOptions)
Utility method to get textual representation of the activation type |
int |
getCheckoutPeriod()
Returns period in days the license is allowed to work offline after checkout without need to obtain/renew lock from the Licensing Server (applicable for USER_LICENSING_NAMED_LS model only) |
int |
getCPULimit()
Returns CPU/Cores limit |
int |
getIntProperty(java.lang.String aPropertyName,
int aDefault)
Utility method to get integer license property |
int |
getLicenseKind()
Returns kind of a license |
java.lang.String |
getLicenseLocation()
Returns location of the license |
int |
getLicenseState()
Returns the state of the license |
java.lang.String |
getLicenseText()
Returns the license agreement text. |
static int |
getLicenseType(java.lang.String aLicenseType)
Utility method to get license type value based on its textual representation |
static java.lang.String |
getLicenseTypeStr(int aLicenseType)
Utility method to get textual representation of the license type |
java.lang.String |
getLicensingServerAddress()
Returns address of Licensing Server in form of IP address or domain name. |
int |
getLockGracePeriod()
Returns lock grace period (in days) for the license |
int |
getLockPeriod()
Returns period in days the license must retain lock to a particular user (applicable for USER_LICENSING_NAMED_LS model only) |
long |
getLongProperty(java.lang.String aPropertyName,
long aDefault)
Utility method to get long license property |
long |
getMemoryLimit()
Returns memory limit in bytes |
int |
getPrevLicenseMajorVersion()
Returns major version of previous license required for the Upgrade kind of license |
int |
getPrevLicenseMinorVersion()
Returns minor version of previous license required for the Upgrade kind of license |
java.util.List<java.lang.String> |
getPrevLicenseProductEditions()
Returns product editions of previous license required for Upgrade kind of license |
java.util.Collection |
getProductFeatureNames()
Returns product features' identifiers contained in the license. |
java.util.HashMap |
getProductFeaturesMap()
Returns product features map. |
java.util.HashMap |
getProperties()
Returns license properties |
java.lang.String |
getProperty(java.lang.String aName,
java.lang.String aDefault)
Gets license property by its name |
java.util.Collection |
getPropertyNames()
Returns the names of the properties contained in the license |
java.lang.String |
getSerialNumber()
Returns serial number for the license |
int |
getUsageGracePeriod()
Returns usage grace period (in usages) for the license |
int |
getUsageLimit()
Returns usage limit for the license |
static java.lang.String |
getUserLicensingModelStr(int aModel)
Utility method to get textual representation of user licensing model |
boolean |
isProductFeatureInLicense(java.lang.String aFeature)
Checks whether certain product feature (functionality) is included into the license. |
boolean |
isProductFeatureSupported(java.lang.String aFeature)
Checks whether certain product feature (functionality) is supported (allowed to be used) by the license. |
boolean |
isProductFeatureSupported(java.lang.String aFeature,
int anIndex)
Checks whether specified feature is supported for the given license type and state combination. |
void |
putIntProperty(java.lang.String aPropertyName,
int aValue)
Puts integer property to the license |
void |
putLongProperty(java.lang.String aPropertyName,
long aValue)
Puts long property to the license |
void |
putProperty(java.lang.String aName,
java.lang.String aValue)
Puts a property to the license |
void |
setActivationGracePeriod(int aValue)
Specifies grace period for activation |
void |
setActivationKey(java.lang.String anActivationKey)
Specifies activation key |
void |
setCheckoutPeriod(int aPeriod)
|
void |
setCPULimit(int aLimit)
|
void |
setLicenseKind(int aLicenseKind)
|
void |
setLicenseLocation(java.lang.String aLicenseLocation)
Specifies license location |
void |
setLicenseState(int aLicenseState)
Specifies license state as one of STATE_ constants |
void |
setLicenseText(java.lang.String aLicenseText)
Specifies the license agreement text. |
void |
setLicensingServerAddress(java.lang.String aValue)
Specifies the address of the Licensing Server that must be used to acquire license lock for this license |
void |
setLockGracePeriod(int aValue)
Specifies grace period for the license lock |
void |
setLockPeriod(int aPeriod)
|
void |
setMemoryLimit(long aLimit)
|
void |
setPrevLicenseMajorVersion(int aMajorVersion)
|
void |
setPrevLicenseMinorVersion(int aMinorVersion)
|
void |
setPrevLicenseProductEditions(java.util.List<java.lang.String> aPrevLicenseProductEditions)
|
void |
setProductFeatureSupported(java.lang.String aFeature,
boolean aValue)
Deprecated. since 1.2 use setProductFeatureSupported(aFeature, anIndex, aValue) instead |
void |
setProductFeatureSupported(java.lang.String aFeature,
int aCase,
boolean aValue)
Specifies that product feature is supported for particular case |
int |
smartGetUserLicensingModel()
Helper method for computing the user licensing model value for pre 3.0 licenses |
static int |
smartGetUserLicensingModel(License aLicense)
Helper method for computing the user licensing model value for pre 3.0 licenses |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jp.protection.pub.LicenseBase |
|---|
getGracePeriod, getLicenseExpireDate, getLicenseIssueDate, getLicenseNumber, getLicenseOptions, getLicenseType, getNumberCopies, getProduct, getProductEdition, getProductMajorVersion, getProductMinorVersion, getUserLicensingModel |
| Field Detail |
|---|
public static final long serialVersionUID
protected int fLicenseState
protected java.lang.String fLicenseText
protected java.util.HashMap fProductFeaturesMap
protected java.lang.String fLicenseLocation
protected java.util.HashMap fProperties
protected static final java.text.DateFormat DATE_FORMAT
public static final java.lang.String TYPE_STR_COMMERCIAL
public static final java.lang.String TYPE_STR_EVALUATION
public static final java.lang.String TYPE_STR_EXTENDED_EVALUATION
public static final java.lang.String USER_LICENSING_UNKNOWN_STR
public static final java.lang.String USER_LICENSING_UNCOUNTED_STR
public static final java.lang.String USER_LICENSING_FLOATING_STR
public static final java.lang.String USER_LICENSING_NAMED_STR
public static final java.lang.String USER_LICENSING_FLOATING_LS_STR
public static final java.lang.String USER_LICENSING_NAMED_LS_STR
| Constructor Detail |
|---|
public LicenseImpl()
| Method Detail |
|---|
public java.lang.String getLicenseLocation()
License
getLicenseLocation in interface Licensepublic void setLicenseLocation(java.lang.String aLicenseLocation)
aLicenseLocation - license locationpublic void setLicenseText(java.lang.String aLicenseText)
aLicenseText - license agreement textpublic java.util.HashMap getProductFeaturesMap()
Boolean value
Boolean[] value containing values
corresponding to each CASE_ case.
public int getLicenseState()
License
getLicenseState in interface LicenseSTATE_constantspublic void setLicenseState(int aLicenseState)
STATE_ constants
aLicenseState - license state to setpublic java.lang.String getLicenseText()
License
getLicenseText in interface Licensepublic boolean isProductFeatureInLicense(java.lang.String aFeature)
License
isProductFeatureInLicense in interface LicenseaFeature - identifier of a feature to check
true if feature is included into the license,
false otherwise.
public void setProductFeatureSupported(java.lang.String aFeature,
boolean aValue)
setProductFeatureSupported(aFeature, anIndex, aValue) instead
aFeature - product feature identifieraValue - true if product feature should be supported; false otherwisepublic java.util.Collection getProductFeatureNames()
License
getProductFeatureNames in interface Licensepublic boolean isProductFeatureSupported(java.lang.String aFeature)
LicenseisProductFeatureSupported(aFeature, CASE_ENABLED) for Standard Edition
or isProductFeatureSupported(aFeature, CASE_COMMERCIAL_ENABLED) for Professional Edition.
isProductFeatureSupported in interface LicenseaFeature - identifier of a feature to check
true if feature is supported by the license,
false otherwise. If feature is not found in the license
it is considered to be unsupported.
public boolean isProductFeatureSupported(java.lang.String aFeature,
int anIndex)
License
isProductFeatureSupported in interface LicenseaFeature - identifier of a feature to checkanIndex - defines license type and state combination to check a feature
against to. Should be one of the CASE_ constants.
true if product feature is supported,
false otherwise
public void setProductFeatureSupported(java.lang.String aFeature,
int aCase,
boolean aValue)
aFeature - product feature identifieraCase - identifies case (one of CASE_ constants) feature should be supported foraValue - true if product feature should be supported; false otherwisepublic java.util.HashMap getProperties()
public java.lang.String getProperty(java.lang.String aName,
java.lang.String aDefault)
License
getProperty in interface LicenseaName - property nameaDefault - default property value used if property is not found in the license
aDefault value if property is not found in the license
public void putProperty(java.lang.String aName,
java.lang.String aValue)
aName - property nameaValue - property valuepublic java.util.Collection getPropertyNames()
License
getPropertyNames in interface Licensepublic java.lang.Object clone()
clone in class java.lang.Objectpublic static java.lang.String getActivationTypeStr(int anOptions)
anOptions - options to the textual representation for
public static java.lang.String getLicenseTypeStr(int aLicenseType)
aLicenseType - license type value
public static int getLicenseType(java.lang.String aLicenseType)
aLicenseType - textual representation of license type
public java.lang.String toString()
toString in class java.lang.Object
public int getIntProperty(java.lang.String aPropertyName,
int aDefault)
aPropertyName - property nameaDefault - default property value used if property is not found in the license
public void putIntProperty(java.lang.String aPropertyName,
int aValue)
aPropertyName - property nameaValue - property valuepublic java.lang.String getLicensingServerAddress()
License
getLicensingServerAddress in interface Licensepublic void setLicensingServerAddress(java.lang.String aValue)
aValue - address of the Licensing Serverpublic int getLockGracePeriod()
License
getLockGracePeriod in interface LicenseNO_GRACE_PERIOD if no grace period is allowedpublic void setLockGracePeriod(int aValue)
aValue - grace period in dayspublic int getActivationGracePeriod()
License
getActivationGracePeriod in interface LicenseNO_GRACE_PERIOD if no grace period is allowedpublic void setActivationGracePeriod(int aValue)
aValue - grace period in dayspublic java.lang.String getActivationKey()
License
getActivationKey in interface Licensepublic void setActivationKey(java.lang.String anActivationKey)
anActivationKey - activation keypublic java.lang.String getSerialNumber()
License
getSerialNumber in interface Licensepublic int getUsageGracePeriod()
License
getUsageGracePeriod in interface LicenseNO_GRACE_PERIOD if no grace period is allowedpublic int getUsageLimit()
License
getUsageLimit in interface Licensepublic int smartGetUserLicensingModel()
public static int smartGetUserLicensingModel(License aLicense)
aLicense - license to compute user licensing model for
public static java.lang.String getUserLicensingModelStr(int aModel)
aModel - user licensing model
public long getLongProperty(java.lang.String aPropertyName,
long aDefault)
aPropertyName - property nameaDefault - default property value used if property is not found in the license
public void putLongProperty(java.lang.String aPropertyName,
long aValue)
aPropertyName - property nameaValue - property valuepublic int getCPULimit()
License
getCPULimit in interface Licensepublic void setCPULimit(int aLimit)
public long getMemoryLimit()
License
getMemoryLimit in interface Licensepublic void setMemoryLimit(long aLimit)
public int getLockPeriod()
LicenseUSER_LICENSING_NAMED_LS model only)
getLockPeriod in interface Licensepublic void setLockPeriod(int aPeriod)
public int getCheckoutPeriod()
LicenseUSER_LICENSING_NAMED_LS model only)
getCheckoutPeriod in interface Licensepublic void setCheckoutPeriod(int aPeriod)
public int getLicenseKind()
License
getLicenseKind in interface LicenseKIND_ constantspublic void setLicenseKind(int aLicenseKind)
public int getPrevLicenseMajorVersion()
License
getPrevLicenseMajorVersion in interface Licensepublic void setPrevLicenseMajorVersion(int aMajorVersion)
public int getPrevLicenseMinorVersion()
License
getPrevLicenseMinorVersion in interface Licensepublic void setPrevLicenseMinorVersion(int aMinorVersion)
public java.util.List<java.lang.String> getPrevLicenseProductEditions()
License
getPrevLicenseProductEditions in interface Licensepublic void setPrevLicenseProductEditions(java.util.List<java.lang.String> aPrevLicenseProductEditions)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||