com.jp.protection.pub.pro.integration
Class HeadlessLicenseReaderIssueResolver

java.lang.Object
  extended by com.jp.protection.pub.pro.integration.IssueResolverSupport
      extended by com.jp.protection.pub.pro.integration.HeadlessLicenseReaderIssueResolver
All Implemented Interfaces:
LicenseReaderIssueResolver, LicenseReaderIssueResolverExt

public class HeadlessLicenseReaderIssueResolver
extends IssueResolverSupport
implements LicenseReaderIssueResolverExt

Headless implementation of the LicenseReaderIssueResolver interface that tries to resolve license reader issues without any involvement of the user.


Field Summary
 
Fields inherited from class com.jp.protection.pub.pro.integration.IssueResolverSupport
fArguments, fCustomer, fLicenseHost, fLicensingFacadeProviderName, fLogin, fPassword, fProductInfo, fSerialNumber, fVerbose, MSG_NO_LICENSING_FACADE, MSG_UNABLE_TO_ACTIVATE, MSG_UNABLE_TO_DEACTIVATE, MSG_UNABLE_TO_GET_EVAL, MSG_UNABLE_TO_GET_LICENSE_BY_S_N
 
Constructor Summary
HeadlessLicenseReaderIssueResolver(ProductInfo aProductInfo, dev.entities.Customer aCustomer)
          Creates a new instance of the license reader issue resolver
 
Method Summary
 boolean resolveLicenseCorrupted(LicenseReader aSource)
           This method is responsible for resolving an issue when license is corrupted.
 boolean resolveLicenseMissing(LicenseReader aSource)
           This method is responsible for resolving an issue when license is missing.
 boolean updateLicense(LicenseReader aSource)
           This method is responsible for updating a license to keep it up-to-date.
static boolean updateLicenseFromLicensingServer(LicenseReader aLicenseReader, LicenseHostPro aLicenseHost, ProductInfo aProductInfo)
          Utility method that allows to update license from Licensing Server.
 
Methods inherited from class com.jp.protection.pub.pro.integration.IssueResolverSupport
activateLicense, deactivateLicense, error, error, getArguments, getCustomer, getEvaluationLicense, getEvaluationLicense, getEvaluationLicense, getEvaluationLicense, getEvaluationLicenseDescr, getLicenseBySerialNumber, getLicenseBySerialNumber, getLicenseBySerialNumber, getLicenseBytes, getLicenseHost, getLicensingFacadeProviderName, getLogin, getPassword, getProductInfo, getSerialNumber, isVerbose, saveLicense, setArguments, setLicenseHost, setLicensingFacadeProviderName, setLogin, setPassword, setSerialNumber, setVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeadlessLicenseReaderIssueResolver

public HeadlessLicenseReaderIssueResolver(ProductInfo aProductInfo,
                                          dev.entities.Customer aCustomer)
Creates a new instance of the license reader issue resolver

Parameters:
aProductInfo - product information
aCustomer - customer information
Method Detail

resolveLicenseMissing

public boolean resolveLicenseMissing(LicenseReader aSource)

This method is responsible for resolving an issue when license is missing. Implementation of this method does:

Method's implementation uses Licensing Facade to obtain licenses.

Specified by:
resolveLicenseMissing in interface LicenseReaderIssueResolver
Parameters:
aSource - identifies license reader calling this method
Returns:
boolean true if issue is resolved; false otherwise

resolveLicenseCorrupted

public boolean resolveLicenseCorrupted(LicenseReader aSource)

This method is responsible for resolving an issue when license is corrupted. Implementation of this method does:

Method's implementation uses Licensing Facade to obtain licenses.

Specified by:
resolveLicenseCorrupted in interface LicenseReaderIssueResolver
Parameters:
aSource - identifies the license reader calling this method
Returns:
boolean true if issue is resolved; false otherwise

updateLicense

public boolean updateLicense(LicenseReader aSource)
Description copied from interface: LicenseReaderIssueResolverExt

This method is responsible for updating a license to keep it up-to-date. Implementation of this method should:

Usual implementation should execute remote call to some backend service knowledgeable of the proper licenses generation procedure.

Specified by:
updateLicense in interface LicenseReaderIssueResolverExt
Parameters:
aSource - identifies the license reader calling this method
Returns:
true if license has been updated or removed; false otherwise

updateLicenseFromLicensingServer

public static boolean updateLicenseFromLicensingServer(LicenseReader aLicenseReader,
                                                       LicenseHostPro aLicenseHost,
                                                       ProductInfo aProductInfo)
                                                throws java.io.IOException
Utility method that allows to update license from Licensing Server. Result of this operation can be either license removal, updated license or nothing if curent license is up-to-date. Note: license will not be reloaded after calling of that method; LicenseReader.getLicense(true) must be called explicitly to apply that change.

Parameters:
aLicenseReader - a LicenseReader to work with
aLicenseHost - a LicenseHost to work with
aProductInfo - a ProductInfo to work with
Returns:
true if update was successful; false otherwise
Throws:
java.io.IOException - if license saving was failed
Since:
v4.8