com.jp.protection.gui.dialogs
Class DefaultLicenseAdapter

java.lang.Object
  extended by com.jp.protection.pub.LicenseAdapter
      extended by com.jp.protection.gui.dialogs.DefaultLicenseAdapter
All Implemented Interfaces:
LicenseHostListener, LicenseListener, LicenseReaderListener, LicenseReaderListenerExt, java.beans.PropertyChangeListener, java.util.EventListener

public class DefaultLicenseAdapter
extends LicenseAdapter
implements java.beans.PropertyChangeListener

Default implementation of the LicenseAdapter. This implementation provides feedback regarding any errors that have occurred during the license reading and validation. Feedback is proveded by presenting the user with the LicenseErrorDialog message dialog. In addition to showing errors and their descriptions the LicenseErrorDialog dialog provides the links which aid the user in sending e-mail regarding product's feedback and to view product's Web site.

See Also:
LicenseAdapter

Field Summary
protected  LicenseErrorDialog fLicenseErrorDialog
           
protected static java.text.MessageFormat FMT_ABOUT_EXPIRE
           
protected static java.text.MessageFormat FMT_NEED_ACTIVATION
           
protected static java.text.MessageFormat FMT_NEED_LOCK
           
protected static java.text.MessageFormat FMT_NOT_LOCKED
           
protected static java.text.MessageFormat FMT_NUMBER_COPIES_VIOLATION
           
protected static java.text.MessageFormat FMT_REASON
           
protected static java.text.MessageFormat FMT_USE_LIMIT
           
protected  ProductInfo fProductInfo
           
(package private) static java.util.ResourceBundle res
           
 
Fields inherited from class com.jp.protection.pub.LicenseAdapter
fVerbose
 
Constructor Summary
DefaultLicenseAdapter()
          Creates a new instance of the DefaultLicenseAdapter
DefaultLicenseAdapter(java.awt.Component aOwner)
          Creates a new instance of the DefaultLicenseAdapter and specifies an owner for the LicenseErrorDialog
 
Method Summary
 java.lang.String getFeedbackText()
          Returns the feedback text displayed by the LicenseErrorDialog
 java.lang.String getFeedbackTooltipText()
          Returns the feedback tooltip text displayed by the LicenseErrorDialog
 java.lang.String getFeedbackURL()
          Returns the feedback URL displayed by the LicenseErrorDialog
 java.lang.String getMessage()
          Returns the message displayed by the LicenseErrorDialog
 ProductInfo getProductInfo()
          Returns the product information associated with the adapter
 java.lang.String getSiteText()
          Returns the name of the site displayed by the LicenseErrorDialog
 java.lang.String getSiteTooltipText()
          Returns the tooltip of the site displayed by the LicenseErrorDialog
 java.lang.String getSiteURL()
          Returns the URL of the site displayed by the LicenseErrorDialog
 java.lang.String getTitle()
          Returns the title for the LicenseErrorDialog
 void licenseAboutToExpire(LicenseHost aSource, License aLicense, int aDaysLeft)
          The License Host calls this method to notify listener that license is about to expire in specified number of days.
Note, this method can be used with Protection! Professional edition only.
 void licenseCorrupted(LicenseReader aSource, java.lang.String aLicenseLocation)
          Shows the message dialog notifying the user that the license is corrupted and therefore can not be read.
 void licenseExpired(LicenseHost aSource, License aLicense)
          Shows the message dialog notifying the user that the license is expired.
 void licenseInvalid(LicenseHost aSource, License aLicense)
          Shows the message dialog notifying the user that the license is invalid e.g.
 void licenseLockExpired(LicenseHost aSource, License aLicense, java.lang.String aReason)
          The License Host calls this method to notify the listener that the license lock has expired.
 void licenseLockRevoked(LicenseHost aSource, License aLicense, java.lang.String aReason)
          The License Host calls this method to notify the listener that the license lock revocation is requested by the Licensing Server administrator.
 void licenseLockViolation(LicenseHost aSource, License aLicense)
          The License Host calls this method to notify listener that license is activated for use on other computer.
Note, this method can be used with Protection! Professional edition only.
 void licenseMissing(LicenseReader aSource, java.lang.String aLicenseLocation)
          Shows the message dialog notifying the user that the license is missing.
 void licenseNeedActivation(LicenseHost aSource, License aLicense, int aDaysLeft)
          The License Host calls this method to notify listener that license need to be activated in aDaysLeft days.
Note, this method can be used with Protection! Professional edition only.
 void licenseNeedLock(LicenseHost aSource, License aLicense, int aDaysLeft)
          The License Host calls this method to notify the listener that the requirement to acquire license lock will be mandatory in aDaysLeft days.
Note, this method can be used with Protection! Professional edition only and can be fired when license need to be locked through the Licensing Server.
 void licenseNotActivated(LicenseHost aSource, License aLicense)
          The License Host calls this method to notify listener that license is not activated.
Note, this method can be used with Protection! Professional edition only.
 void licenseNotLocked(LicenseHost aSource, License aLicense, java.lang.String aReason)
          The License Host calls this method to notify the listener that license lock has not been acquired.
 void licenseUseLimitAboutReach(LicenseHost aSource, License aLicense, int aUseLeft)
          The License Host calls this method to notify listener that license is about to expire after specified number of usages.
Note, this method can be used with Protection! Professional edition only.
 void numberCopiesViolation(LicenseHost aSource, License aLicense, int aNumberInUse)
          The License Host calls this method to notify listener that the actual number of concurrently executing applications, which use the same license, exceed maximum allowed number.
Note, this method can be used with Protection! Professional edition only.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setFeedbackText(java.lang.String aFeedbackText)
          Specifies the feedback text to be displayed by the LicenseErrorDialog
 void setFeedbackTooltipText(java.lang.String aFeedbackTooltipText)
          Specifies the feedback tooltip text to be displayed by the LicenseErrorDialog
 void setFeedbackURL(java.lang.String aFeedbackURL)
          Specifies the feedback URL to be displayed by the LicenseErrorDialog
 void setMessage(java.lang.String aMessage)
          Specifies the message to be displayed by the LicenseErrorDialog
 void setProductInfo(ProductInfo aProductInfo)
          Specifies the product information associated to be associated with the adapter
 void setSiteText(java.lang.String aSiteText)
          Specifies the name of the site to be displayed by the LicenseErrorDialog
 void setSiteTooltipText(java.lang.String aSiteTooltipText)
          Specifies the tooltip of the site to be displayed by the LicenseErrorDialog
 void setSiteURL(java.lang.String aSiteURL)
          Specifies the URL of the site to be displayed by the LicenseErrorDialog
 void setTitle(java.lang.String aTitle)
          Specifies the title for the LicenseErrorDialog
 
Methods inherited from class com.jp.protection.pub.LicenseAdapter
error, featureChecked, isVerbose, licenseAboutToRead, licenseAccepted, licenseAvailable, licenseOk, licenseRemoved, licenseUpdated, message, setVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

res

static java.util.ResourceBundle res

fLicenseErrorDialog

protected LicenseErrorDialog fLicenseErrorDialog

fProductInfo

protected ProductInfo fProductInfo

FMT_ABOUT_EXPIRE

protected static final java.text.MessageFormat FMT_ABOUT_EXPIRE

FMT_USE_LIMIT

protected static final java.text.MessageFormat FMT_USE_LIMIT

FMT_NUMBER_COPIES_VIOLATION

protected static final java.text.MessageFormat FMT_NUMBER_COPIES_VIOLATION

FMT_NEED_ACTIVATION

protected static final java.text.MessageFormat FMT_NEED_ACTIVATION

FMT_REASON

protected static final java.text.MessageFormat FMT_REASON

FMT_NOT_LOCKED

protected static final java.text.MessageFormat FMT_NOT_LOCKED

FMT_NEED_LOCK

protected static final java.text.MessageFormat FMT_NEED_LOCK
Constructor Detail

DefaultLicenseAdapter

public DefaultLicenseAdapter()
Creates a new instance of the DefaultLicenseAdapter


DefaultLicenseAdapter

public DefaultLicenseAdapter(java.awt.Component aOwner)
Creates a new instance of the DefaultLicenseAdapter and specifies an owner for the LicenseErrorDialog

Parameters:
aOwner - an owner for the LicenseErrorDialog
Method Detail

getTitle

public java.lang.String getTitle()
Returns the title for the LicenseErrorDialog

Returns:
the title for the LicenseErrorDialog

setTitle

public void setTitle(java.lang.String aTitle)
Specifies the title for the LicenseErrorDialog

Parameters:
aTitle - the title for the LicenseErrorDialog

getMessage

public java.lang.String getMessage()
Returns the message displayed by the LicenseErrorDialog

Returns:
the error message displayed by the LicenseErrorDialog

setMessage

public void setMessage(java.lang.String aMessage)
Specifies the message to be displayed by the LicenseErrorDialog

Parameters:
aMessage - the error message to be displayed by the LicenseErrorDialog

getSiteText

public java.lang.String getSiteText()
Returns the name of the site displayed by the LicenseErrorDialog

Returns:
the name of the site displayed by the LicenseErrorDialog

setSiteText

public void setSiteText(java.lang.String aSiteText)
Specifies the name of the site to be displayed by the LicenseErrorDialog

Parameters:
aSiteText - the name of the site to be displayed by the LicenseErrorDialog

getSiteTooltipText

public java.lang.String getSiteTooltipText()
Returns the tooltip of the site displayed by the LicenseErrorDialog

Returns:
the tooltip of the site displayed by the LicenseErrorDialog

setSiteTooltipText

public void setSiteTooltipText(java.lang.String aSiteTooltipText)
Specifies the tooltip of the site to be displayed by the LicenseErrorDialog

Parameters:
aSiteTooltipText - the tooltip of the site to be displayed by the LicenseErrorDialog

getSiteURL

public java.lang.String getSiteURL()
Returns the URL of the site displayed by the LicenseErrorDialog

Returns:
the URL of the site displayed by the LicenseErrorDialog

setSiteURL

public void setSiteURL(java.lang.String aSiteURL)
Specifies the URL of the site to be displayed by the LicenseErrorDialog

Parameters:
aSiteURL - the URL of the site to be displayed by the LicenseErrorDialog

getFeedbackText

public java.lang.String getFeedbackText()
Returns the feedback text displayed by the LicenseErrorDialog

Returns:
the feedback text displayed by the LicenseErrorDialog

setFeedbackText

public void setFeedbackText(java.lang.String aFeedbackText)
Specifies the feedback text to be displayed by the LicenseErrorDialog

Parameters:
aFeedbackText - the feedback text to be displayed by the LicenseErrorDialog

getFeedbackTooltipText

public java.lang.String getFeedbackTooltipText()
Returns the feedback tooltip text displayed by the LicenseErrorDialog

Returns:
the feedback tooltip text displayed by the LicenseErrorDialog

setFeedbackTooltipText

public void setFeedbackTooltipText(java.lang.String aFeedbackTooltipText)
Specifies the feedback tooltip text to be displayed by the LicenseErrorDialog

Parameters:
aFeedbackTooltipText - the feedback tooltip text to be displayed by the LicenseErrorDialog

getFeedbackURL

public java.lang.String getFeedbackURL()
Returns the feedback URL displayed by the LicenseErrorDialog

Returns:
the feedback URL displayed by the LicenseErrorDialog

setFeedbackURL

public void setFeedbackURL(java.lang.String aFeedbackURL)
Specifies the feedback URL to be displayed by the LicenseErrorDialog

Parameters:
aFeedbackURL - the feedback URL to be displayed by the LicenseErrorDialog

licenseCorrupted

public void licenseCorrupted(LicenseReader aSource,
                             java.lang.String aLicenseLocation)
Shows the message dialog notifying the user that the license is corrupted and therefore can not be read.

Specified by:
licenseCorrupted in interface LicenseReaderListener
Overrides:
licenseCorrupted in class LicenseAdapter
Parameters:
aSource - the license reader.
aLicenseLocation - full path to the license file.

licenseExpired

public void licenseExpired(LicenseHost aSource,
                           License aLicense)
Shows the message dialog notifying the user that the license is expired.

Specified by:
licenseExpired in interface LicenseHostListener
Overrides:
licenseExpired in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.

licenseInvalid

public void licenseInvalid(LicenseHost aSource,
                           License aLicense)
Shows the message dialog notifying the user that the license is invalid e.g. it is issued for a different product.

Specified by:
licenseInvalid in interface LicenseHostListener
Overrides:
licenseInvalid in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.

licenseMissing

public void licenseMissing(LicenseReader aSource,
                           java.lang.String aLicenseLocation)
Shows the message dialog notifying the user that the license is missing.

Specified by:
licenseMissing in interface LicenseReaderListener
Overrides:
licenseMissing in class LicenseAdapter
Parameters:
aSource - the license host.
aLicenseLocation - instance of the license.

licenseNotActivated

public void licenseNotActivated(LicenseHost aSource,
                                License aLicense)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is not activated.
Note, this method can be used with Protection! Professional edition only.

Specified by:
licenseNotActivated in interface LicenseHostListener
Overrides:
licenseNotActivated in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.

getProductInfo

public ProductInfo getProductInfo()
Returns the product information associated with the adapter

Returns:
the product information associated with the adapter

setProductInfo

public void setProductInfo(ProductInfo aProductInfo)
Specifies the product information associated to be associated with the adapter

Parameters:
aProductInfo - the product information to be associated with the adapter

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

licenseAboutToExpire

public void licenseAboutToExpire(LicenseHost aSource,
                                 License aLicense,
                                 int aDaysLeft)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is about to expire in specified number of days.
Note, this method can be used with Protection! Professional edition only.

Specified by:
licenseAboutToExpire in interface LicenseHostListener
Overrides:
licenseAboutToExpire in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aDaysLeft - days left to license expiration.

licenseUseLimitAboutReach

public void licenseUseLimitAboutReach(LicenseHost aSource,
                                      License aLicense,
                                      int aUseLeft)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is about to expire after specified number of usages.
Note, this method can be used with Protection! Professional edition only.

Specified by:
licenseUseLimitAboutReach in interface LicenseHostListener
Overrides:
licenseUseLimitAboutReach in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aUseLeft - usages left to license expiration.

licenseLockViolation

public void licenseLockViolation(LicenseHost aSource,
                                 License aLicense)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is activated for use on other computer.
Note, this method can be used with Protection! Professional edition only.

Specified by:
licenseLockViolation in interface LicenseHostListener
Overrides:
licenseLockViolation in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.

numberCopiesViolation

public void numberCopiesViolation(LicenseHost aSource,
                                  License aLicense,
                                  int aNumberInUse)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that the actual number of concurrently executing applications, which use the same license, exceed maximum allowed number.
Note, this method can be used with Protection! Professional edition only.

Specified by:
numberCopiesViolation in interface LicenseHostListener
Overrides:
numberCopiesViolation in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aNumberInUse - actual number of copies in use.

licenseNeedActivation

public void licenseNeedActivation(LicenseHost aSource,
                                  License aLicense,
                                  int aDaysLeft)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license need to be activated in aDaysLeft days.
Note, this method can be used with Protection! Professional edition only.

Specified by:
licenseNeedActivation in interface LicenseHostListener
Overrides:
licenseNeedActivation in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aDaysLeft - number of days left till the license will be considered as not activated one

licenseNotLocked

public void licenseNotLocked(LicenseHost aSource,
                             License aLicense,
                             java.lang.String aReason)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify the listener that license lock has not been acquired.
Note, this method can be used with Protection! Professional edition only. and can be fired when license need to be locked through the Licensing Server

Specified by:
licenseNotLocked in interface LicenseHostListener
Overrides:
licenseNotLocked in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aReason - why license lock is not acquired

licenseNeedLock

public void licenseNeedLock(LicenseHost aSource,
                            License aLicense,
                            int aDaysLeft)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify the listener that the requirement to acquire license lock will be mandatory in aDaysLeft days.
Note, this method can be used with Protection! Professional edition only and can be fired when license need to be locked through the Licensing Server.

Specified by:
licenseNeedLock in interface LicenseHostListener
Overrides:
licenseNeedLock in class LicenseAdapter
Parameters:
aSource - the License Host.
aLicense - instance of the license.
aDaysLeft - number of days left untill the license will be considered as not locked one

licenseLockExpired

public void licenseLockExpired(LicenseHost aSource,
                               License aLicense,
                               java.lang.String aReason)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify the listener that the license lock has expired. This issue can occur when connection to the Licensing Server is lost due to the network failure or the Licensing Server failure. It is sole responsibility of client application to properly handle this state e.g. ignoring it and letting application work as usual or showing prompt to the user and exiting application etc.
Note, this method can be used with Protection! Professional edition only. and can be fired when license need to be locked through the Licensing Server

Specified by:
licenseLockExpired in interface LicenseHostListener
Overrides:
licenseLockExpired in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aReason - why license is expired

licenseLockRevoked

public void licenseLockRevoked(LicenseHost aSource,
                               License aLicense,
                               java.lang.String aReason)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify the listener that the license lock revocation is requested by the Licensing Server administrator. This issue can occur when the Licensing Server administrator marks a license session as revoked.
Note, this method can be used with Protection! Professional edition only. and can be fired when license need to be locked through the Licensing Server

Specified by:
licenseLockRevoked in interface LicenseHostListener
Overrides:
licenseLockRevoked in class LicenseAdapter
Parameters:
aSource - the license host.
aLicense - instance of the license.
aReason - why license lock revocation is requested.