com.jp.protection.pub
Class LicenseHost

java.lang.Object
  extended by com.jp.protection.pub.LicenseHost
Direct Known Subclasses:
LicenseHostPro

public class LicenseHost
extends java.lang.Object

This class is intended to check license and notify interested listeners about the checking process and its results. It works in conjunction with a LicenseReader instance used to locate and read license.

See Also:
LicenseReader, LicenseHostListener, LicenseReaderListener, DefaultLicenseAcceptanceDelegate

Field Summary
protected static java.text.DateFormat DATE_FORMAT
           
protected  boolean fAllowFlexibleExpirationDate
           
protected  LicenseHostIssueResolver fIssueResolver
           
protected  LicenseAcceptanceDelegate fLicenseAcceptanceDelegate
           
protected  java.util.Vector fLicenseHostListeners
           
protected  LicenseReader fLicenseReader
           
protected  java.lang.String fLicenseTextCommercial
           
protected  java.lang.String fLicenseTextEvaluation
           
protected  java.util.List fSecretStorages
           
protected  boolean fVerbose
           
static java.lang.String LICENSE_HOST_HINT_CLEAR_PREVIOUS_SHUTDOWN_DATE
           
static java.lang.String PROPERTY_ALREADY_EXPIRED
          Defines the name of the property used to store the alreadyExpired property in the SecretStorages
protected static java.lang.String PROPERTY_FLEXIBLE_EXP_DATE_PROCESSED
           
static java.lang.String PROPERTY_LICENSE_ACCEPTED
          Defines the name of the property used to store the licenseAccepted property in the SecretStorages
static java.lang.String PROPERTY_PREVIOUS_EXPIRATION_DATE
          Defines the name of the property used to store the previousExpirationDate property in the SecretStorages
static java.lang.String PROPERTY_PREVIOUS_SHUTDOWN_DATE
          Defines the name of the property used to store the previousShutdownDate property in the SecretStorages
 
Constructor Summary
LicenseHost()
          Constructs a LicenseHost instance.
LicenseHost(LicenseReader aLicenseReader)
          Constructs a LicenseHost instance and assigns the LicenseReader instance.
LicenseHost(LicenseReader aLicenseReader, LicenseHostListener aLicenseHostListener)
          Constructs a LicenseHost instance, assigns LicenseReader instance and adds a LicenseHostListener.
 
Method Summary
 void addLicenseHostListener(LicenseHostListener l)
          Adds a LicenseHostListener to the list of listeners
 void addSecretStorage(SecretStorage aSecretStorage)
          Adds a SecretStorage instance to the list of secret storages.
protected  boolean checkActivation(LicenseImpl aLicense)
           
protected  void checkCommercial(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  void checkEvaluation(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkExpiration(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkExpirationImpl(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
 void checkLicense(java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
          Main method of the LicenseHost that does all the work of license checking against provided parameters.
 void checkLicense(java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion, boolean aForceLicenseRead)
          Main method of the LicenseHost that does all the work of license checking against provided parameters.
protected  void checkLicenseAcceptance(License aLicense)
           
protected  boolean checkLicenseLock(LicenseImpl aLicense)
           
protected  boolean checkLicenseUpgrade(License aLicense)
           
protected  boolean checkProduct(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkProductFeatures(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkProductFeaturesImpl(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkProductImpl(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkProductVersions(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected  boolean checkProductVersionsImpl(LicenseImpl aLicense, java.lang.String aProduct, int aProductMajorVersion, int aProductMinorVersion)
           
protected static boolean dateIn(java.util.Date aDate, java.util.Date aStart, java.util.Date aFinish)
           
protected  void error(java.lang.String aMessage)
           
protected  void error(java.lang.Throwable ex)
           
protected  void fireFeatureChecked(LicenseHost aSource, License aLicense, java.lang.String aFeature, boolean isEnabled)
           
protected  void fireLicenseAccepted(LicenseHost aSource, License aLicense, boolean isAccepted)
           
protected  void fireLicenseExpired(LicenseHost aSource, License aLicense)
           
protected  void fireLicenseInvalid(LicenseHost aSource, License aLicense)
           
protected  void fireLicenseOk(LicenseHost aSource, License aLicense)
           
protected  void fireProductFeaturesSupported(License aLicense)
           
protected  java.lang.String getAlreadyExpiredPropertyName()
           
 LicenseHostIssueResolver getIssueResolver()
          Returns issue resolver instance
 License getLicense()
          Returns license read by the LicenseReader
 License getLicense(boolean aForceRead)
          Returns license read by the LicenseReader
 LicenseAcceptanceDelegate getLicenseAcceptanceDelegate()
          Returns the LicenseAcceptanceDelegate instance used during the license checking procedure to ensure that the license is accepted or rejected
 java.util.Date getLicenseExpirationDate(boolean useGracePeriod)
          Returns the license expiration date based on expiration date stored in the current license and pervious expiration read from Secret Storage's.
 java.lang.String getLicenseExpireInfo(License aLicense)
          Composes and returns textual representation of the license expiration information.
 LicenseReader getLicenseReader()
          Returns the LicenseReader instance used to read licenses
 java.lang.String getLicenseTextCommercial()
          Returns the text of the commercial license agreement, which should be assigned to the license during the checking procedure.
 java.lang.String getLicenseTextEvaluation()
          Returns the text of the evaluation license agreement, which should be assigned to the license during the checking procedure.
 java.util.Date getPreviousExpirationDate()
          Returns the first known expiration date using values stored in Secret Storage's.
protected  java.lang.String getPreviousExpirationDatePropertyName()
           
 java.util.List getSecretStorages()
          Returns the list of secret storages
 boolean isAllowFlexibleExpirationDate()
          Checks whether the expiration date of the read license should be adjusted based on the combination of the current system date and the specified duration of the evaluation period.
protected  boolean isAlreadyExpired()
           
protected  boolean isFlexibleExpirationDateProcessed(LicenseImpl aLicense)
           
 boolean isLicenseAccepted()
          Checks whether the license is already accepted by the user.
 boolean isVerbose()
          Checks whether license host runs in verbose mode.
 boolean loadSecretStorageBooleanProperty(java.lang.String aPropertyName, boolean isOrOperation, boolean aDefaultValue, boolean aForceLoad)
          Loads boolean property value from Secret Storage's.
 java.util.Date loadSecretStorageDateProperty(java.lang.String aPropertyName, boolean isEarliest, java.util.Date aDefaultValue, boolean aForceLoad)
          Loads date property value from Secret Storage's.
 int loadSecretStorageIntProperty(java.lang.String aPropertyName, boolean isMax, long aDefaultValue, boolean aForceLoad)
          Loads int property value from Secret Storage's.
 long loadSecretStorageLongProperty(java.lang.String aPropertyName, boolean isMax, long aDefaultValue, boolean aForceLoad)
          Loads long property value from Secret Storage's.
 java.lang.String loadSecretStorageProperty(java.lang.String aPropertyName, java.lang.String aDefaultValue)
          Loads first encountered property value from Secret Storage's.
static java.lang.String loadText(java.lang.Class aBaseClass, java.lang.String aResourceName)
          Utility method for loading text from the application resource.
protected  void processFlexibleExpirationDate(LicenseImpl aLicense)
           
 void release()
          Releases all the resources acquired by License Host
 void removeLicenseHostListener(LicenseHostListener l)
          Removes a LicenseHostListener
 void removeSecretStorage(SecretStorage aSecretStorage)
          Removes the SecretStorage instance from the list of secret storages.
 void saveSecretStorageProperty(java.lang.String aPropertyName, java.lang.String aValue)
          Saves property value to all registered Secret Storage's.
 void setAllowFlexibleExpirationDate(boolean anAllowFlexibleExpirationDate)
          Specifies whether the expiration date of the read license should be adjusted based on the combination of the current system date and the specified duration of the evaluation period.
protected  void setAreadyExpired(boolean aValue)
           
protected  void setFlexibleExpirationDateProcessed(LicenseImpl aLicense, boolean aValue)
           
 void setIssueResolver(LicenseHostIssueResolver aIssueResolver)
          Specifies issue resolver
 void setLicenseAcceptanceDelegate(LicenseAcceptanceDelegate aLicenseAcceptanceDelegate)
          Specifies a LicenseAcceptanceDelegate instance, which should be used during the license checking procedure to ensure that the license is accepted or rejected
 void setLicenseAccepted(boolean aValue)
          Specifies whether license is already accepted by the user.
 void setLicenseReader(LicenseReader aLicenseReader)
          Specifies a LicenseReader instance used to read licenses
protected  void setLicenseState(LicenseImpl aLicense, int aState)
           
 void setLicenseTextCommercial(java.lang.String aLicenseTextCommercial)
          Specifies the text of the commercial license agreement, which should be assigned to the license during the checking procedure.
 void setLicenseTextEvaluation(java.lang.String aLicenseTextEvaluation)
          Specifies the text of the evaluation license agreement, which should be assigned to the license during the checking procedure.
protected  void setPreviousExpirationDate(java.util.Date aDate)
           
 void setVerbose(boolean aVerbose)
          Specifies that license host should run in verbose mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLicenseReader

protected LicenseReader fLicenseReader

fSecretStorages

protected java.util.List fSecretStorages

fLicenseAcceptanceDelegate

protected LicenseAcceptanceDelegate fLicenseAcceptanceDelegate

fLicenseTextCommercial

protected java.lang.String fLicenseTextCommercial

fLicenseTextEvaluation

protected java.lang.String fLicenseTextEvaluation

fIssueResolver

protected LicenseHostIssueResolver fIssueResolver

fVerbose

protected boolean fVerbose

PROPERTY_LICENSE_ACCEPTED

public static final java.lang.String PROPERTY_LICENSE_ACCEPTED
Defines the name of the property used to store the licenseAccepted property in the SecretStorages

See Also:
Constant Field Values

PROPERTY_ALREADY_EXPIRED

public static final java.lang.String PROPERTY_ALREADY_EXPIRED
Defines the name of the property used to store the alreadyExpired property in the SecretStorages

See Also:
Constant Field Values

PROPERTY_PREVIOUS_EXPIRATION_DATE

public static final java.lang.String PROPERTY_PREVIOUS_EXPIRATION_DATE
Defines the name of the property used to store the previousExpirationDate property in the SecretStorages

See Also:
Constant Field Values

PROPERTY_PREVIOUS_SHUTDOWN_DATE

public static final java.lang.String PROPERTY_PREVIOUS_SHUTDOWN_DATE
Defines the name of the property used to store the previousShutdownDate property in the SecretStorages

See Also:
Constant Field Values

LICENSE_HOST_HINT_CLEAR_PREVIOUS_SHUTDOWN_DATE

public static final java.lang.String LICENSE_HOST_HINT_CLEAR_PREVIOUS_SHUTDOWN_DATE
See Also:
Constant Field Values

fLicenseHostListeners

protected java.util.Vector fLicenseHostListeners

fAllowFlexibleExpirationDate

protected boolean fAllowFlexibleExpirationDate

PROPERTY_FLEXIBLE_EXP_DATE_PROCESSED

protected static final java.lang.String PROPERTY_FLEXIBLE_EXP_DATE_PROCESSED
See Also:
Constant Field Values

DATE_FORMAT

protected static final java.text.DateFormat DATE_FORMAT
Constructor Detail

LicenseHost

public LicenseHost()
Constructs a LicenseHost instance. Note: a valid LicenseReader instance should be assigned to allow license checking.


LicenseHost

public LicenseHost(LicenseReader aLicenseReader)
Constructs a LicenseHost instance and assigns the LicenseReader instance.

Parameters:
aLicenseReader - an instance to assign

LicenseHost

public LicenseHost(LicenseReader aLicenseReader,
                   LicenseHostListener aLicenseHostListener)
Constructs a LicenseHost instance, assigns LicenseReader instance and adds a LicenseHostListener.

Parameters:
aLicenseReader - a LicenseReader instance to assign
aLicenseHostListener - a LicenseHostListener to add
Method Detail

getIssueResolver

public LicenseHostIssueResolver getIssueResolver()
Returns issue resolver instance

Returns:
an instance of LicenseHostIssueResolver

setIssueResolver

public void setIssueResolver(LicenseHostIssueResolver aIssueResolver)
Specifies issue resolver

Parameters:
aIssueResolver - an instance of the LicenseHostIssueResolver

getLicenseTextCommercial

public java.lang.String getLicenseTextCommercial()
Returns the text of the commercial license agreement, which should be assigned to the license during the checking procedure.

Returns:
text of the commercial license agreement

setLicenseTextCommercial

public void setLicenseTextCommercial(java.lang.String aLicenseTextCommercial)
Specifies the text of the commercial license agreement, which should be assigned to the license during the checking procedure.

Parameters:
aLicenseTextCommercial - text of the commercial license agreement

getLicenseTextEvaluation

public java.lang.String getLicenseTextEvaluation()
Returns the text of the evaluation license agreement, which should be assigned to the license during the checking procedure.

Returns:
text of the evaluation license agreement

setLicenseTextEvaluation

public void setLicenseTextEvaluation(java.lang.String aLicenseTextEvaluation)
Specifies the text of the evaluation license agreement, which should be assigned to the license during the checking procedure.

Parameters:
aLicenseTextEvaluation - text of the evaluation license agreement

getLicenseAcceptanceDelegate

public LicenseAcceptanceDelegate getLicenseAcceptanceDelegate()
Returns the LicenseAcceptanceDelegate instance used during the license checking procedure to ensure that the license is accepted or rejected

Returns:
a LicenseAcceptanceDelegate instance; null if not yet assigned

setLicenseAcceptanceDelegate

public void setLicenseAcceptanceDelegate(LicenseAcceptanceDelegate aLicenseAcceptanceDelegate)
Specifies a LicenseAcceptanceDelegate instance, which should be used during the license checking procedure to ensure that the license is accepted or rejected

Parameters:
aLicenseAcceptanceDelegate - LicenseAcceptanceDelegate instance to assign

addSecretStorage

public void addSecretStorage(SecretStorage aSecretStorage)
Adds a SecretStorage instance to the list of secret storages.

Parameters:
aSecretStorage - a SecretStorage instance to add

removeSecretStorage

public void removeSecretStorage(SecretStorage aSecretStorage)
Removes the SecretStorage instance from the list of secret storages.

Parameters:
aSecretStorage - a SecretStorage instance to remove

getSecretStorages

public java.util.List getSecretStorages()
Returns the list of secret storages

Returns:
list of secret storages

getLicenseReader

public LicenseReader getLicenseReader()
Returns the LicenseReader instance used to read licenses

Returns:
the LicenseReader instance

setLicenseReader

public void setLicenseReader(LicenseReader aLicenseReader)
Specifies a LicenseReader instance used to read licenses

Parameters:
aLicenseReader - a LicenseReader instance to assign

checkLicense

public void checkLicense(java.lang.String aProduct,
                         int aProductMajorVersion,
                         int aProductMinorVersion)
Main method of the LicenseHost that does all the work of license checking against provided parameters. It is possible to analyze checking procedure results after this method return by reading the license properties or during the license checking by listening to the various events using the LicenseHostListener(s) and the LicenseReaderListener(s) listeners

Parameters:
aProduct - product identifier
aProductMajorVersion - major version of the product. The license is considered valid if the aProductMajorVersion is equals to the license productMajorVersion property.
aProductMinorVersion - minor version of the product. The license is considered valid if the aProductMinorVersion is less or equals to the license productMinorVersion property.

checkLicense

public void checkLicense(java.lang.String aProduct,
                         int aProductMajorVersion,
                         int aProductMinorVersion,
                         boolean aForceLicenseRead)
Main method of the LicenseHost that does all the work of license checking against provided parameters. It is possible to analyze checking results after this method return by reading the license properties or during the license checking by listening to the various events using the LicenseHostListener(s) and the LicenseReaderListener(s) listeners

Parameters:
aProduct - product identifier
aProductMajorVersion - major version of the product. The license is considered valid if the aProductMajorVersion is equals to the license productMajorVersion property.
aProductMinorVersion - minor version of the product. The license is considered as valid if the aProductMinorVersion is less or equals to the license productMinorVersion property.
aForceLicenseRead - forces LicenseReader to re-read license

isVerbose

public boolean isVerbose()
Checks whether license host runs in verbose mode.

Returns:
true if license host runs in verbose mode, false otherwise.

setVerbose

public void setVerbose(boolean aVerbose)
Specifies that license host should run in verbose mode. If it runs in verbose mode all exceptions stack traces and error messages will be printed to std err. Otherwise there is no output in order to prevent the code flow analysis.

Parameters:
aVerbose - true if reader should run in verbose mode, false otherwise.

error

protected void error(java.lang.String aMessage)

error

protected void error(java.lang.Throwable ex)

fireProductFeaturesSupported

protected void fireProductFeaturesSupported(License aLicense)

setLicenseState

protected void setLicenseState(LicenseImpl aLicense,
                               int aState)

checkProductImpl

protected boolean checkProductImpl(LicenseImpl aLicense,
                                   java.lang.String aProduct,
                                   int aProductMajorVersion,
                                   int aProductMinorVersion)

checkProduct

protected boolean checkProduct(LicenseImpl aLicense,
                               java.lang.String aProduct,
                               int aProductMajorVersion,
                               int aProductMinorVersion)

checkProductVersionsImpl

protected boolean checkProductVersionsImpl(LicenseImpl aLicense,
                                           java.lang.String aProduct,
                                           int aProductMajorVersion,
                                           int aProductMinorVersion)

checkProductVersions

protected boolean checkProductVersions(LicenseImpl aLicense,
                                       java.lang.String aProduct,
                                       int aProductMajorVersion,
                                       int aProductMinorVersion)

checkProductFeaturesImpl

protected boolean checkProductFeaturesImpl(LicenseImpl aLicense,
                                           java.lang.String aProduct,
                                           int aProductMajorVersion,
                                           int aProductMinorVersion)

checkProductFeatures

protected boolean checkProductFeatures(LicenseImpl aLicense,
                                       java.lang.String aProduct,
                                       int aProductMajorVersion,
                                       int aProductMinorVersion)

dateIn

protected static boolean dateIn(java.util.Date aDate,
                                java.util.Date aStart,
                                java.util.Date aFinish)

checkExpiration

protected final boolean checkExpiration(LicenseImpl aLicense,
                                        java.lang.String aProduct,
                                        int aProductMajorVersion,
                                        int aProductMinorVersion)

checkExpirationImpl

protected boolean checkExpirationImpl(LicenseImpl aLicense,
                                      java.lang.String aProduct,
                                      int aProductMajorVersion,
                                      int aProductMinorVersion)

checkLicenseAcceptance

protected void checkLicenseAcceptance(License aLicense)

checkCommercial

protected void checkCommercial(LicenseImpl aLicense,
                               java.lang.String aProduct,
                               int aProductMajorVersion,
                               int aProductMinorVersion)

checkLicenseUpgrade

protected boolean checkLicenseUpgrade(License aLicense)

checkActivation

protected boolean checkActivation(LicenseImpl aLicense)

checkLicenseLock

protected boolean checkLicenseLock(LicenseImpl aLicense)

checkEvaluation

protected void checkEvaluation(LicenseImpl aLicense,
                               java.lang.String aProduct,
                               int aProductMajorVersion,
                               int aProductMinorVersion)

getLicenseExpirationDate

public java.util.Date getLicenseExpirationDate(boolean useGracePeriod)
Returns the license expiration date based on expiration date stored in the current license and pervious expiration read from Secret Storage's. It also optionally clarifies result if grace period is specified by decreasing expiration date.

Parameters:
useGracePeriod - specifies whether grace period should be used to clarify result.
Returns:
license expiration date; null if unknown.

getPreviousExpirationDatePropertyName

protected java.lang.String getPreviousExpirationDatePropertyName()

getPreviousExpirationDate

public java.util.Date getPreviousExpirationDate()
Returns the first known expiration date using values stored in Secret Storage's.

Returns:
previous expiration date; null if unknown.

setPreviousExpirationDate

protected void setPreviousExpirationDate(java.util.Date aDate)

loadSecretStorageDateProperty

public java.util.Date loadSecretStorageDateProperty(java.lang.String aPropertyName,
                                                    boolean isEarliest,
                                                    java.util.Date aDefaultValue,
                                                    boolean aForceLoad)
Loads date property value from Secret Storage's.

Parameters:
aPropertyName - name of the property to return.
isEarliest - specifies that the earliest found date should be returned.
aDefaultValue - value should be returned if property is not found
aForceLoad - forces Secret Storage to reload its state
Returns:
property value; aDefaultValue if property is not found in any storage.

loadSecretStorageIntProperty

public int loadSecretStorageIntProperty(java.lang.String aPropertyName,
                                        boolean isMax,
                                        long aDefaultValue,
                                        boolean aForceLoad)
Loads int property value from Secret Storage's.

Parameters:
aPropertyName - name of the property to return.
isMax - specifies that the maximum found value should be returned; minimum otherwise.
aDefaultValue - value should be returned if property is not found
aForceLoad - forces Secret Storage to reload its state
Returns:
property value; aDefaultValue if property is not found in any storage.

loadSecretStorageLongProperty

public long loadSecretStorageLongProperty(java.lang.String aPropertyName,
                                          boolean isMax,
                                          long aDefaultValue,
                                          boolean aForceLoad)
Loads long property value from Secret Storage's.

Parameters:
aPropertyName - name of the property to return.
isMax - specifies that the maximum found value should be returned; minimum otherwise.
aDefaultValue - value should be returned if property is not found
aForceLoad - forces Secret Storage to reload its state
Returns:
property value; aDefaultValue if property is not found in any storage.

loadSecretStorageBooleanProperty

public boolean loadSecretStorageBooleanProperty(java.lang.String aPropertyName,
                                                boolean isOrOperation,
                                                boolean aDefaultValue,
                                                boolean aForceLoad)
Loads boolean property value from Secret Storage's.

Parameters:
aPropertyName - name of the property to return.
isOrOperation - specifies that boolean OR operation should be applied to found values; AND operation will be applied otherwise.
aDefaultValue - value should be returned if property is not found
aForceLoad - forces Secret Storage to reload its state
Returns:
property value; aDefaultValue if property is not found in any storage.

saveSecretStorageProperty

public void saveSecretStorageProperty(java.lang.String aPropertyName,
                                      java.lang.String aValue)
Saves property value to all registered Secret Storage's.

Parameters:
aPropertyName - name of the property to save.
aValue - value of the property to save

loadSecretStorageProperty

public java.lang.String loadSecretStorageProperty(java.lang.String aPropertyName,
                                                  java.lang.String aDefaultValue)
Loads first encountered property value from Secret Storage's.

Parameters:
aPropertyName - name of the property to return.
aDefaultValue - value should be returned if property is not found
Returns:
property value; aDefaultValue if property is not found in any storage.

getAlreadyExpiredPropertyName

protected java.lang.String getAlreadyExpiredPropertyName()

isAlreadyExpired

protected boolean isAlreadyExpired()

setAreadyExpired

protected void setAreadyExpired(boolean aValue)

setLicenseAccepted

public void setLicenseAccepted(boolean aValue)
Specifies whether license is already accepted by the user. Method implementation uses the SecretStorages to save the specified value

Parameters:
aValue - true if license is already accepted by the user; false otherwise

isLicenseAccepted

public boolean isLicenseAccepted()
Checks whether the license is already accepted by the user. Method implementation asks the SecretStorages to determine a return value

Returns:
true if license is already accepted by the user; false otherwise

addLicenseHostListener

public void addLicenseHostListener(LicenseHostListener l)
Adds a LicenseHostListener to the list of listeners

Parameters:
l - a LicenseHostListener to be added

removeLicenseHostListener

public void removeLicenseHostListener(LicenseHostListener l)
Removes a LicenseHostListener

Parameters:
l - a LicenseHostListener to be removed

fireLicenseAccepted

protected void fireLicenseAccepted(LicenseHost aSource,
                                   License aLicense,
                                   boolean isAccepted)

fireLicenseExpired

protected void fireLicenseExpired(LicenseHost aSource,
                                  License aLicense)

fireLicenseOk

protected void fireLicenseOk(LicenseHost aSource,
                             License aLicense)

fireLicenseInvalid

protected void fireLicenseInvalid(LicenseHost aSource,
                                  License aLicense)

fireFeatureChecked

protected void fireFeatureChecked(LicenseHost aSource,
                                  License aLicense,
                                  java.lang.String aFeature,
                                  boolean isEnabled)

getLicense

public License getLicense()
Returns license read by the LicenseReader

Returns:
the License instance

getLicense

public License getLicense(boolean aForceRead)
Returns license read by the LicenseReader

Parameters:
aForceRead - forces LicenseReader to re-read license
Returns:
the License instance

isAllowFlexibleExpirationDate

public boolean isAllowFlexibleExpirationDate()
Checks whether the expiration date of the read license should be adjusted based on the combination of the current system date and the specified duration of the evaluation period. This option is useful when creating the evaluation bundles where the end-user can use the product for a specified number of days starting from the application's first usage date rather than from the license issue date.

Returns:
true if this property is turned on; false otherwise

setAllowFlexibleExpirationDate

public void setAllowFlexibleExpirationDate(boolean anAllowFlexibleExpirationDate)
Specifies whether the expiration date of the read license should be adjusted based on the combination of the current system date and the specified duration of the evaluation period. This option is useful when creating the evaluation bundles where the end-user can use the product for a specified number of days starting from the application's first usage date rather than from the license issue date.

Parameters:
anAllowFlexibleExpirationDate - true if expiration date of read license should be adjusted according to the current date and duration of the evaluation period; false otherwise

isFlexibleExpirationDateProcessed

protected boolean isFlexibleExpirationDateProcessed(LicenseImpl aLicense)

setFlexibleExpirationDateProcessed

protected void setFlexibleExpirationDateProcessed(LicenseImpl aLicense,
                                                  boolean aValue)

processFlexibleExpirationDate

protected void processFlexibleExpirationDate(LicenseImpl aLicense)

release

public void release()
Releases all the resources acquired by License Host


loadText

public static java.lang.String loadText(java.lang.Class aBaseClass,
                                        java.lang.String aResourceName)
Utility method for loading text from the application resource.

Parameters:
aBaseClass - a base class to load resource.
aResourceName - a resource name.
Returns:
text loaded from the application resource.
Since:
3.0

getLicenseExpireInfo

public java.lang.String getLicenseExpireInfo(License aLicense)
Composes and returns textual representation of the license expiration information.

Parameters:
aLicense - to return expiration information for.
Returns:
textual representation of the license expiration information.
Since:
3.0