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

java.lang.Object
  extended by com.jp.protection.pub.pro.integration.IssueResolverSupport
Direct Known Subclasses:
HeadlessLicenseHostIssueResolver, HeadlessLicenseReaderIssueResolver

public class IssueResolverSupport
extends java.lang.Object

Base class for issue resolvers implementation. Provides vital methods required to get and activate licenses.


Field Summary
protected  java.util.HashMap fArguments
           
protected  dev.entities.Customer fCustomer
           
protected  LicenseHost fLicenseHost
           
protected  java.lang.String fLicensingFacadeProviderName
           
protected  java.lang.String fLogin
           
protected  java.lang.String fPassword
           
protected  ProductInfo fProductInfo
           
protected  java.lang.String fSerialNumber
           
protected  boolean fVerbose
           
protected static java.lang.String MSG_NO_LICENSING_FACADE
           
protected static java.lang.String MSG_UNABLE_TO_ACTIVATE
           
protected static java.lang.String MSG_UNABLE_TO_DEACTIVATE
           
protected static java.lang.String MSG_UNABLE_TO_GET_EVAL
           
protected static java.lang.String MSG_UNABLE_TO_GET_LICENSE_BY_S_N
           
 
Constructor Summary
IssueResolverSupport(ProductInfo aProductInfo, dev.entities.Customer aCustomer)
          Creates a new instance of the IssueResolverSupport
 
Method Summary
 boolean activateLicense(LicenseHost aLicenseHost, java.lang.String anActivationKey)
          Activates license and saves it to a location specified by the license reader
 boolean deactivateLicense(LicenseHost aLicenseHost, java.lang.String aDeactivationKey)
          Notifies vendor about results of deactivation process
protected  void error(java.lang.Exception ex)
           
protected  void error(java.lang.String aMessage)
           
 java.util.HashMap getArguments()
          Returns arguments required to get or activate licenses
 dev.entities.Customer getCustomer()
          Returns customer information who is requesting or activating the license
 boolean getEvaluationLicense()
          Obtains new evaluation license and saves it to a location specified by the License Reader Note, License Reader should be properly specified before the call of the method
 boolean getEvaluationLicense(boolean isExtEvaluation)
          Obtains new evaluation license and saves it to a location specified by the License Reader Note, License Reader should be properly specified before the call of the method
 boolean getEvaluationLicense(LicenseReader aLicenseReader)
          Obtains new evaluation license and saves it to a location specified by the license reader
 boolean getEvaluationLicense(LicenseReader aLicenseReader, boolean isExtEvaluation)
          Obtains new evaluation license and saves it to a location specified by the license reader
protected  LicenseDescr getEvaluationLicenseDescr(boolean isExtEvaluation)
           
 boolean getLicenseBySerialNumber()
          Obtains new license by Serial Number and saves it to a location specified by the License Reader.
 boolean getLicenseBySerialNumber(LicenseReader aLicenseReader)
          Obtains new license by Serial Number and saves it to a location specified by the license reader
 boolean getLicenseBySerialNumber(LicenseReader aLicenseReader, java.lang.String aSerialNumber)
          Obtains new license by Serial Number and saves it to a location specified by the license reader
protected  byte[] getLicenseBytes(LicenseHost aLicenseHost)
           
 LicenseHost getLicenseHost()
          Returns License Host can be used in order to get or activate licenses
 java.lang.String getLicensingFacadeProviderName()
          Returns the name of licensing facade, which should be used to get or activate licenses
 java.lang.String getLogin()
          Returns login name
 java.lang.String getPassword()
          Returns password
 ProductInfo getProductInfo()
          Return product information
 java.lang.String getSerialNumber()
          Returns serial number
 boolean isVerbose()
          Checks whether reader runs in verbose mode.
protected  boolean saveLicense(LicenseReader aLicenseReader, byte[] licenseBytes)
           
 void setArguments(java.util.HashMap aArguments)
          Specifies arguments required to get or activate licenses
 void setLicenseHost(LicenseHost aLicenseHost)
          Specifies License Host can be used in order to get or activate licenses
 void setLicensingFacadeProviderName(java.lang.String aLicensingFacadeProviderName)
          Specifies name of licensing facade, which should be used to get or activate licenses
 void setLogin(java.lang.String aLogin)
          Specifies login name should be passed to all calls of the LicensingFacade methods
 void setPassword(java.lang.String aPassword)
          Specifies password should be passed to all calls of the LicensingFacade methods
 void setSerialNumber(java.lang.String aSerialNumber)
          Specifies serial number value, which should be used when license is missing, corrupted, expired or invalid.
 void setVerbose(boolean aVerbose)
          Specifies that this class should be run in verbose mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fProductInfo

protected ProductInfo fProductInfo

fCustomer

protected dev.entities.Customer fCustomer

fLogin

protected java.lang.String fLogin

fPassword

protected java.lang.String fPassword

fSerialNumber

protected java.lang.String fSerialNumber

fLicensingFacadeProviderName

protected java.lang.String fLicensingFacadeProviderName

MSG_UNABLE_TO_GET_EVAL

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

MSG_UNABLE_TO_GET_LICENSE_BY_S_N

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

MSG_UNABLE_TO_ACTIVATE

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

MSG_UNABLE_TO_DEACTIVATE

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

MSG_NO_LICENSING_FACADE

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

fVerbose

protected boolean fVerbose

fArguments

protected java.util.HashMap fArguments

fLicenseHost

protected LicenseHost fLicenseHost
Constructor Detail

IssueResolverSupport

public IssueResolverSupport(ProductInfo aProductInfo,
                            dev.entities.Customer aCustomer)
Creates a new instance of the IssueResolverSupport

Parameters:
aProductInfo - describes product information
aCustomer - describes customer information who requests or activates the license
Method Detail

getLogin

public java.lang.String getLogin()
Returns login name

Returns:
login name

setLogin

public void setLogin(java.lang.String aLogin)
Specifies login name should be passed to all calls of the LicensingFacade methods

Parameters:
aLogin - login name

getPassword

public java.lang.String getPassword()
Returns password

Returns:
password

setPassword

public void setPassword(java.lang.String aPassword)
Specifies password should be passed to all calls of the LicensingFacade methods

Parameters:
aPassword - password

getCustomer

public dev.entities.Customer getCustomer()
Returns customer information who is requesting or activating the license

Returns:
customer information

getProductInfo

public ProductInfo getProductInfo()
Return product information

Returns:
product information

getSerialNumber

public java.lang.String getSerialNumber()
Returns serial number

Returns:
serial number

setSerialNumber

public void setSerialNumber(java.lang.String aSerialNumber)
Specifies serial number value, which should be used when license is missing, corrupted, expired or invalid.

Parameters:
aSerialNumber - serial number

getLicensingFacadeProviderName

public java.lang.String getLicensingFacadeProviderName()
Returns the name of licensing facade, which should be used to get or activate licenses

Returns:
the name of licensing facade

setLicensingFacadeProviderName

public void setLicensingFacadeProviderName(java.lang.String aLicensingFacadeProviderName)
Specifies name of licensing facade, which should be used to get or activate licenses

Parameters:
aLicensingFacadeProviderName - the name of licensing facade

getEvaluationLicenseDescr

protected LicenseDescr getEvaluationLicenseDescr(boolean isExtEvaluation)

saveLicense

protected boolean saveLicense(LicenseReader aLicenseReader,
                              byte[] licenseBytes)

getEvaluationLicense

public boolean getEvaluationLicense()
Obtains new evaluation license and saves it to a location specified by the License Reader Note, License Reader should be properly specified before the call of the method

Returns:
true is license is successfully obtained; false otherwise

getEvaluationLicense

public boolean getEvaluationLicense(LicenseReader aLicenseReader)
Obtains new evaluation license and saves it to a location specified by the license reader

Parameters:
aLicenseReader - license reader
Returns:
true is license is successfully obtained; false otherwise

getEvaluationLicense

public boolean getEvaluationLicense(boolean isExtEvaluation)
Obtains new evaluation license and saves it to a location specified by the License Reader Note, License Reader should be properly specified before the call of the method

Parameters:
isExtEvaluation - specifies whether extended evaluation license is required
Returns:
true is license is successfully obtained; false otherwise

getEvaluationLicense

public boolean getEvaluationLicense(LicenseReader aLicenseReader,
                                    boolean isExtEvaluation)
Obtains new evaluation license and saves it to a location specified by the license reader

Parameters:
aLicenseReader - license reader
isExtEvaluation - specifies whether extended evaluation license is required
Returns:
true is license is successfully obtained; false otherwise

getLicenseBySerialNumber

public boolean getLicenseBySerialNumber()
Obtains new license by Serial Number and saves it to a location specified by the License Reader. Note, Serial Number and License Reader should be properly assigned before call of the method.

Returns:
true is license is successfully obtained; false otherwise

getLicenseBySerialNumber

public boolean getLicenseBySerialNumber(LicenseReader aLicenseReader)
Obtains new license by Serial Number and saves it to a location specified by the license reader

Parameters:
aLicenseReader - license reader
Returns:
true is license is successfully obtained; false otherwise

getLicenseBySerialNumber

public boolean getLicenseBySerialNumber(LicenseReader aLicenseReader,
                                        java.lang.String aSerialNumber)
Obtains new license by Serial Number and saves it to a location specified by the license reader

Parameters:
aLicenseReader - license reader
aSerialNumber - serial number
Returns:
true is license is successfully obtained; false otherwise

activateLicense

public boolean activateLicense(LicenseHost aLicenseHost,
                               java.lang.String anActivationKey)
Activates license and saves it to a location specified by the license reader

Parameters:
aLicenseHost - license host
anActivationKey - activation key
Returns:
true is license is successfully obtained; false otherwise

deactivateLicense

public boolean deactivateLicense(LicenseHost aLicenseHost,
                                 java.lang.String aDeactivationKey)
Notifies vendor about results of deactivation process

Parameters:
aLicenseHost - license host
aDeactivationKey - deactivation key
Returns:
true if license has been deactivated on a vedor side; false otherwise

getLicenseBytes

protected byte[] getLicenseBytes(LicenseHost aLicenseHost)

isVerbose

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

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

setVerbose

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

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

getArguments

public java.util.HashMap getArguments()
Returns arguments required to get or activate licenses

Returns:
arguments

setArguments

public void setArguments(java.util.HashMap aArguments)
Specifies arguments required to get or activate licenses

Parameters:
aArguments - arguments

getLicenseHost

public LicenseHost getLicenseHost()
Returns License Host can be used in order to get or activate licenses

Returns:
LicenseHost license host instance

setLicenseHost

public void setLicenseHost(LicenseHost aLicenseHost)
Specifies License Host can be used in order to get or activate licenses

Parameters:
aLicenseHost - License Host instance

error

protected void error(java.lang.String aMessage)

error

protected void error(java.lang.Exception ex)