com.jp.protection.pub.pro
Class LicenseUpgradeChecker

java.lang.Object
  extended by com.jp.protection.pub.pro.LicenseUpgradeChecker

public class LicenseUpgradeChecker
extends java.lang.Object

This class is responsible of checking whether upgrade license is valid by finding and analyzing license of previous versions

Since:
v5.0

Nested Class Summary
static class LicenseUpgradeChecker.BackupLicenseReader
          Special sub-class of LicenseReader that allows reading licenses from backup
static class LicenseUpgradeChecker.FileLicenseReader
          Special sub-class of LicenseReader that allows reading licenses from a specified file
 
Field Summary
protected  LicenseHostPro fLicenseHost
           
protected  java.util.List<LicenseLocation> fPrevLicenseLocations
           
static java.lang.String PROP_CHECK_LICENSE_UPGRADE
           
static java.lang.String PROP_PREV_LICENSE_MAJOR_VERSION
           
static java.lang.String PROP_PREV_LICENSE_MINOR_VERSION
           
 
Constructor Summary
LicenseUpgradeChecker(LicenseHostPro aLicenseHost)
          Creates a new instance of LicenseUpgradeChecker
 
Method Summary
 void addPrevLicenseLocation(LicenseLocation aLocation)
          Adds location for license of previous version
protected  boolean checkLicenseProductEditions(License aNewLicense, License aAnOldLicense)
           
 boolean checkLicenseUpgrade(License aNewLicense)
          Checks whether upgrade license is valid by finding and analyzing license of previous versions
protected  boolean checkLicenseUpgrade(License aNewLicense, License anOldLicense)
           
protected  boolean checkLicenseUpgradeImpl(LicenseReader aLicenseReader, License aNewLicense)
           
protected  boolean checkLicenseVersions(License aNewLicense, License anOldLicense)
           
protected  long composeVersion(int aMajorVersion, int aMinorVersion)
           
protected  LicenseReader createBackupLicenseReader()
           
protected  LicenseReader createFileLicenseReader(java.io.File aFile)
           
protected  java.util.List<LicenseReader> getLicenseReaders()
           
protected  void initLicenseReader(LicenseReader aLicenseReader)
           
 boolean isCheckLicenseUpgrade(License aLicense)
          Tests whether license check need to be performed by looking up the Secret Storages for PROP_CHECK_LICENSE_UPGRADE property value
 void removePrevLicenseLocation(LicenseLocation aLocation)
          Removes location for license of previous version
 void setCheckLicenseUpgrade(License aLicense, boolean aValue)
          Specifies whether license check need to be performed by storing the PROP_CHECK_LICENSE_UPGRADE property in the Secret Storages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLicenseHost

protected LicenseHostPro fLicenseHost

PROP_PREV_LICENSE_MAJOR_VERSION

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

PROP_PREV_LICENSE_MINOR_VERSION

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

PROP_CHECK_LICENSE_UPGRADE

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

fPrevLicenseLocations

protected java.util.List<LicenseLocation> fPrevLicenseLocations
Constructor Detail

LicenseUpgradeChecker

public LicenseUpgradeChecker(LicenseHostPro aLicenseHost)
Creates a new instance of LicenseUpgradeChecker

Parameters:
aLicenseHost - an instance of LicenseHostPro this checker will work with
Method Detail

checkLicenseUpgrade

public boolean checkLicenseUpgrade(License aNewLicense)
Checks whether upgrade license is valid by finding and analyzing license of previous versions

Parameters:
aNewLicense - a new license to check
Returns:
boolean

getLicenseReaders

protected java.util.List<LicenseReader> getLicenseReaders()

isCheckLicenseUpgrade

public boolean isCheckLicenseUpgrade(License aLicense)
Tests whether license check need to be performed by looking up the Secret Storages for PROP_CHECK_LICENSE_UPGRADE property value

Parameters:
aLicense - a license to test
Returns:
true if license check need to be performed; false otherwise

setCheckLicenseUpgrade

public void setCheckLicenseUpgrade(License aLicense,
                                   boolean aValue)
Specifies whether license check need to be performed by storing the PROP_CHECK_LICENSE_UPGRADE property in the Secret Storages

Parameters:
aLicense - a license
aValue - true if check need to be performed; false otherwise

checkLicenseUpgradeImpl

protected boolean checkLicenseUpgradeImpl(LicenseReader aLicenseReader,
                                          License aNewLicense)

checkLicenseUpgrade

protected boolean checkLicenseUpgrade(License aNewLicense,
                                      License anOldLicense)

checkLicenseProductEditions

protected boolean checkLicenseProductEditions(License aNewLicense,
                                              License aAnOldLicense)

checkLicenseVersions

protected boolean checkLicenseVersions(License aNewLicense,
                                       License anOldLicense)

composeVersion

protected long composeVersion(int aMajorVersion,
                              int aMinorVersion)

createBackupLicenseReader

protected LicenseReader createBackupLicenseReader()

createFileLicenseReader

protected LicenseReader createFileLicenseReader(java.io.File aFile)

initLicenseReader

protected void initLicenseReader(LicenseReader aLicenseReader)

addPrevLicenseLocation

public void addPrevLicenseLocation(LicenseLocation aLocation)
Adds location for license of previous version

Parameters:
aLocation - a LicenseLocation

removePrevLicenseLocation

public void removePrevLicenseLocation(LicenseLocation aLocation)
Removes location for license of previous version

Parameters:
aLocation - a LicenseLocation