com.jp.protection.pub
Class LicenseAdapter

java.lang.Object
  extended by com.jp.protection.pub.LicenseAdapter
All Implemented Interfaces:
LicenseHostListener, LicenseListener, LicenseReaderListener, LicenseReaderListenerExt, java.util.EventListener
Direct Known Subclasses:
DefaultLicenseAdapter, LicensingServiceSupport

public class LicenseAdapter
extends java.lang.Object
implements LicenseListener

An abstract adapter class for receiving license events. All methods of this class provide simple message output to the System.out stream if verbose mode is specified. This class exists as convenience for creating listener objects.

See Also:
LicenseListener

Field Summary
protected  boolean fVerbose
           
 
Constructor Summary
LicenseAdapter()
           
LicenseAdapter(boolean aVerbose)
           
 
Method Summary
protected  void error(java.lang.String aMessage)
           
 void featureChecked(LicenseHost aSource, License aLicense, java.lang.String aFeature, boolean isEnabled)
          The License Host calls this method to notify listener that product feature is checked and available.
 boolean isVerbose()
           
 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 licenseAboutToRead(LicenseReader aSource, java.lang.String aProductID)
          License reader calls this method to notify listener that the license is about to be read and specifies a known ID of the product this license is issued for.
 void licenseAccepted(LicenseHost aSource, License aLicense, boolean isAccepted)
          The License Host calls this method to notify listener that license agreement is accepted or declined by the user.
 void licenseAvailable(LicenseReader aSource, java.lang.String aLicenseLocation)
          License reader calls this method to notify listener that the license is successfully read and available for use.
 void licenseCorrupted(LicenseReader aSource, java.lang.String aLicenseLocation)
          License reader calls this method to notify listener that the license is corrupted and therefore can not be read.
 void licenseExpired(LicenseHost aSource, License aLicense)
          The License Host calls this method to notify listener that license is already expired.
 void licenseInvalid(LicenseHost aSource, License aLicense)
          The License Host calls this method to notify listener that 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)
          License reader calls this method to notify listener when the license is not found neither in the resource folder nor in the file system.
 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 licenseOk(LicenseHost aSource, License aLicense)
          The License Host calls this method to notify listener that license is OK.
 void licenseRemoved(LicenseReader aSource, java.lang.String aLicenseLocation)
          License reader calls this method to notify listener that the license was removed beacuse it was revoked or not available anymore e.g.
 void licenseUpdated(LicenseReader aSource, java.lang.String aLicenseLocation)
          License reader calls this method to notify listener that the license was updated by getting up-to-date version from a remote service such as from Licensing Server
 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.
protected  void message(java.lang.String aMessage)
           
 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 setVerbose(boolean aVerbose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fVerbose

protected boolean fVerbose
Constructor Detail

LicenseAdapter

public LicenseAdapter()

LicenseAdapter

public LicenseAdapter(boolean aVerbose)
Method Detail

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean aVerbose)

error

protected void error(java.lang.String aMessage)

message

protected void message(java.lang.String aMessage)

licenseAccepted

public void licenseAccepted(LicenseHost aSource,
                            License aLicense,
                            boolean isAccepted)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license agreement is accepted or declined by the user.

Specified by:
licenseAccepted in interface LicenseHostListener
Parameters:
aSource - the license host.
aLicense - instance of the license.
isAccepted - true if license agreement is accepted, false otherwise.

licenseMissing

public void licenseMissing(LicenseReader aSource,
                           java.lang.String aLicenseLocation)
Description copied from interface: LicenseReaderListener
License reader calls this method to notify listener when the license is not found neither in the resource folder nor in the file system.

Specified by:
licenseMissing in interface LicenseReaderListener
Parameters:
aSource - the license reader.
aLicenseLocation - full path to the license file.

licenseCorrupted

public void licenseCorrupted(LicenseReader aSource,
                             java.lang.String aLicenseLocation)
Description copied from interface: LicenseReaderListener
License reader calls this method to notify listener that the license is corrupted and therefore can not be read.

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

licenseAvailable

public void licenseAvailable(LicenseReader aSource,
                             java.lang.String aLicenseLocation)
Description copied from interface: LicenseReaderListener
License reader calls this method to notify listener that the license is successfully read and available for use.

Specified by:
licenseAvailable in interface LicenseReaderListener
Parameters:
aSource - the license reader.
aLicenseLocation - full path to the license file.

licenseRemoved

public void licenseRemoved(LicenseReader aSource,
                           java.lang.String aLicenseLocation)
Description copied from interface: LicenseReaderListenerExt
License reader calls this method to notify listener that the license was removed beacuse it was revoked or not available anymore e.g. user allocation was changed in Licensing Server

Specified by:
licenseRemoved in interface LicenseReaderListenerExt
Parameters:
aSource - the license reader.
aLicenseLocation - license location

licenseUpdated

public void licenseUpdated(LicenseReader aSource,
                           java.lang.String aLicenseLocation)
Description copied from interface: LicenseReaderListenerExt
License reader calls this method to notify listener that the license was updated by getting up-to-date version from a remote service such as from Licensing Server

Specified by:
licenseUpdated in interface LicenseReaderListenerExt
Parameters:
aSource - the license reader.
aLicenseLocation - license location

licenseExpired

public void licenseExpired(LicenseHost aSource,
                           License aLicense)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is already expired.

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

licenseOk

public void licenseOk(LicenseHost aSource,
                      License aLicense)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is OK.

Specified by:
licenseOk in interface LicenseHostListener
Parameters:
aSource - the license host.
aLicense - instance of the license.

licenseInvalid

public void licenseInvalid(LicenseHost aSource,
                           License aLicense)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that license is invalid e.g. it's issued for a different product.

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

featureChecked

public void featureChecked(LicenseHost aSource,
                           License aLicense,
                           java.lang.String aFeature,
                           boolean isEnabled)
Description copied from interface: LicenseHostListener
The License Host calls this method to notify listener that product feature is checked and available.

Specified by:
featureChecked in interface LicenseHostListener
Parameters:
aSource - the license host.
aLicense - instance of the license.
aFeature - name of the feature.
isEnabled - true if feature is enabled, false otherwise.

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
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
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
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
Parameters:
aSource - the license host.
aLicense - instance of the license.
aNumberInUse - actual number of copies in use.

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
Parameters:
aSource - the license host.
aLicense - instance of the license.

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
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

licenseAboutToRead

public void licenseAboutToRead(LicenseReader aSource,
                               java.lang.String aProductID)
Description copied from interface: LicenseReaderListener
License reader calls this method to notify listener that the license is about to be read and specifies a known ID of the product this license is issued for. Listener's implementation can employ this method to locate a particular product and assign valid private key bytes to the reader.

Specified by:
licenseAboutToRead in interface LicenseReaderListener
Parameters:
aSource - the license reader.
aProductID - ID of the product this license is issued for.

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
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

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
Parameters:
aSource - the license host.
aLicense - instance of the license.
aReason - why license lock is not acquired

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
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
Parameters:
aSource - the license host.
aLicense - instance of the license.
aReason - why license lock revocation is requested.