com.jp.protection.priv.pro.integration
Class LocalLicensingFacade

java.lang.Object
  extended by com.jp.protection.priv.pro.integration.LocalLicensingFacade
All Implemented Interfaces:
ProductsStorage.PasswordResolver, LicensingFacade

public class LocalLicensingFacade
extends java.lang.Object
implements LicensingFacade, ProductsStorage.PasswordResolver

Default implementation of the LicensingFacade that works with product storage specified as the local file or input stream. This implementation provides all the core methods for the licenses generation and activation and can be used as the foundation for publishing license facade functionality using some remote invocation technology such as RMI or Web Services


Nested Class Summary
static class LocalLicensingFacade.Provider
          LicensingFacadeProvider implementation aware of LocalLicensingFacade instances providing
 
Field Summary
protected  boolean fActivateLicenseEnabled
           
protected  boolean fCommercialEnabled
           
protected  boolean fDeactivateLicenseEnabled
           
protected  int fDefaultDeliveryType
           
protected  LicensingFacadeDelegate fDelegate
           
protected  java.util.HashMap fDeliveryMap
           
protected  boolean fEvaluationEnabled
           
protected  LicensingFacadeExtension fExtension
           
protected  boolean fExtEvaluationEnabled
           
protected  boolean fGetByDescrEnabled
           
protected  boolean fGetBySerialNumberEnabled
           
protected  boolean fGetEnabled
           
protected  LicenseReaderFacade fLicenseReaderFacade
           
protected  LicenseWriterFacade fLicenseWriterFacade
           
protected  LicensingFacadeConfig fLicensingFacadeConfig
           
protected  java.lang.String fLogin
           
protected static int fLogLevel
           
protected  java.lang.String fPassword
           
protected static java.util.Map fPluginFactoryMap
           
protected static com.jp.protection.utils.ProtectionLogger fProtectionLogger
           
protected  java.lang.String fReadProtectionPassword
           
protected  java.lang.String fVersion
           
static java.lang.String LOGGER_NAME
           
static java.lang.String SUB_VERSION
           
static java.lang.String VERSION
           
 
Fields inherited from interface com.jp.protection.pub.pro.integration.LicensingFacade
ARGUMENT_ACTIVATION_KEY, ARGUMENT_ACTIVATION_LOCK_KEY, ARGUMENT_HOST_NAME, ARGUMENT_IP_ADDRESS, ARGUMENT_LICENSE_FEATURE_PREFIX, ARGUMENT_LICENSE_PROPERTY_FREFIX, ARGUMENT_LOCALE, ARGUMENT_USE_COUNT_LEFT, ARGUMENT_USER
 
Constructor Summary
LocalLicensingFacade()
          Creates new instance of the LocalLicensingFacade
LocalLicensingFacade(java.io.File aProductsStorageFile)
          Creates new instance of the LocalLicensingFacade and loads products storage from the specified local file.
LocalLicensingFacade(java.io.InputStream aProductsStorageInputStream)
          Creates new instance of the LocalLicensingFacade and loads products storage from the specified input stream.
 
Method Summary
 LicensingFacadeResult activateLicense(byte[] aLicenseBytes, dev.entities.Customer aCustomer, java.lang.String anActivationKey, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments)
          Activates a license specified as an array of bytes.
 void addDelivery(int aDeliveryType, LicensingFacadeDelivery aDelivery)
          Registers delivery object for certain delivery type
 boolean checkActivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Checks whether license activation is enabled.
 boolean checkDeactivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Checks whether license deactivation is enabled.
protected  boolean checkGetLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
           
static void closePluginFactories()
           
static void closePluginFactory(java.lang.String aPluginFactoryClassName)
           
protected  LicenseImpl createLicense(LicenseDescr aLicenseDescr, dev.entities.Customer aCustomer)
           
protected  LicenseImpl createLicense(LicensingFacadeSession aSession, LicenseBase aLicenseInfo, dev.entities.Customer aCustomer)
           
protected  LicenseImpl createLicense(java.lang.String aSerialNumber)
           
 LicensingFacadeResult deactivateLicense(byte[] aLicenseBytes, java.lang.String aDeactivationKey, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments)
          Deactivates a license at the vendors side.
protected  void finalize()
           
protected  java.lang.String generateLicenseNumber(LicenseBase aLicenseInfo, dev.entities.Customer aCustomer)
           
static java.lang.String getAPIVersion()
           
static java.lang.String getDeactivationKey(Product aProduct, java.lang.String anActivationKey, boolean isCompleted, boolean isStrippedActivationKeyChars)
           
 java.lang.String getDeactivationKey(java.lang.String aProductID, java.lang.String anActivationKey, boolean isCompleted, boolean isStrippedActivationKeyChars)
           
 int getDefaultDeliveryType()
          Returns default delivery type
 LicensingFacadeDelegate getDelegate()
          Returns 'delegate' plug-in used by this class to delegate all LicensingFacade functionality to
 LicensingFacadeDelivery getDelivery(int aDeliveryType)
          Returns registered delivery object for the specified delivery type
 LicensingFacadeExtension getExtension()
          Returns 'extension' plug-in used to extends the functionality of the class
 LicensingFacadeResult getLicense(LicenseDescr aLicenseDescr, dev.entities.Customer aCustomer, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments)
          Generates a license according to the provided license descriptor.
 LicensingFacadeResult getLicense(LicenseInfo aLicenseInfo, dev.entities.Customer aCustomer, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments)
          Generates a license according to provided license information.
 LicensingFacadeResult getLicense(java.lang.String aSerialNumber, dev.entities.Customer aCustomer, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments)
          Generates a license according to the provided Serial Number.
protected  byte[] getLicenseBytes(LicensingFacadeSession aSession, LicenseBase aLicenseInfo, dev.entities.Customer aCustomer)
           
 LicenseReaderFacade getLicenseReaderFacade()
          Returns license reader facade used to read licenses
 LicenseWriterFacade getLicenseWriterFacade()
          Returns license writer facade used to write licenses
 LicensingFacadeConfig getLicensingFacadeConfig()
          Returns configuration specified for this object
protected  LicensingFacadeResult getLicensingFacadeResult(LicensingFacadeSession aSession, LicensingFacadeResultBase anExtensionResult, License aLicense, dev.entities.Customer aCustomer)
           
static com.jp.protection.utils.ProtectionLogger getLogger()
           
 java.lang.String getLogin()
          Returns login name
 java.lang.String getPassword()
          Returns password
protected  LicensingFacadePluginFactory getPluginFactory()
           
static LicensingFacadePluginFactory getPluginFactory(java.lang.String aPluginFactoryClassName)
           
 ProductsStorage getProductsStorage()
          Returns products storage that this class is working with
 java.lang.String getReadProtectionPassword()
           
protected  java.lang.String getSerialNumber(LicenseBase aLicenseInfo)
           
 java.lang.String getVersion()
          Returns the version of implementation.
 void init(java.io.File aProductsStorageFile)
          Initialize an instance of the LocalLicensingFacade and loads products storage from the specified local file.
 void init(java.io.InputStream aProductsStorageInputStream)
          Initialize an instance of the LocalLicensingFacade and loads products storage from the specified input stream.
 void init(LicensingFacadeConfig aLicensingFacadeConfig, java.lang.Class aBaseClass)
          Provides initialization according to the specified configuration
protected  void initPlugin()
           
 boolean isActivateLicenseEnabled()
          Returns whether license activation is enabled.
 boolean isCommercialEnabled()
          Returns whether process of obtaining commercial licenses is enabled.
 boolean isDeactivateLicenseEnabled()
           
 boolean isEvaluationEnabled()
          Returns whether process of obtaining evaluation licenses is enabled.
 boolean isExtEvaluationEnabled()
          Returns whether process of obtaining extended evaluation licenses is enabled.
 boolean isGetByDescrEnabled()
           
 boolean isGetBySerialNumberEnabled()
          Returns whether process of obtaining licenses by Serial Number is enabled.
 boolean isGetEnabled()
           
 boolean isGetLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Returns whether ability of obtaining licenses of a certain type (specified by supplied license information) is enabled
 boolean isLoginEnabled(LicenseBase aLicenseInfo, java.lang.String aLogin, java.lang.String aPassword)
          Checks whether login information is correct and it is possible to execute the LicensingFacade methods
static boolean isSerialNumberOrigin(LicenseBase aLicenseInfo)
           
 void log(LicensingFacadeResultBase aResult)
           
 void log(LicensingFacadeSession aSession)
           
protected  LicensingFacadeSession login(LicenseBase aLicenseInfo, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments, int anOperation)
           
protected  LicensingFacadeResult loginFailedError(java.lang.String aLogin, java.lang.String aPassword)
           
 boolean lsLicenseProperlyDeactivated(java.lang.String aProductID, java.lang.String anActivationKey, java.lang.String aDeactivationKey)
           
protected  LicensingFacadeResult notAllowedError(java.lang.String anAccessType)
           
protected  LicensingFacadeResult notEligibleError()
           
 void passwordMismatch()
           
protected  void putActivationKey(LicenseImpl aLicense, java.util.Map anArguments)
           
 LicensingFacadeDelivery removeDelivery(int aDeliveryType)
          Unregisters delivery object for certain delivery type
 java.lang.String resolvePassword()
           
protected  LicensingFacadeResult sendByEmail(byte[] aLicenseBytes, dev.entities.Customer aCustomer)
           
 void setActivateLicenseEnabled(boolean aActivateLicenseEnabled)
          Specifies whether license activation should be enabled.
 void setCommercialEnabled(boolean aCommercialEnabled)
          Specifies whether process of obtaining commercial licenses should be enabled.
 void setDeactivateLicenseEnabled(boolean aDeactivateLicenseEnabled)
           
 void setDefaultDeliveryType(int aDefaultDeliveryType)
          Specifies default delivery type
 void setDelegate(LicensingFacadeDelegate aLocalLicensingFacadeDelegate)
          Specifies 'delegate' plug-in used by this class to delegate all LicensingFacade functionality to
 void setEvaluationEnabled(boolean aEvaluationEnabled)
          Specifies whether process of obtaining evaluation licenses should be enabled.
 void setExtension(LicensingFacadeExtension aLocalLicensingFacadeExtension)
          Specifies 'extension' plug-in used to extend the functionality of the class
 void setExtEvaluationEnabled(boolean aExtEvaluationEnabled)
          Specifies whether process of obtaining extended evaluation licenses should be enabled.
 void setGetByDescrEnabled(boolean aGetByDescrEnabled)
           
 void setGetBySerialNumberEnabled(boolean aGetBySerialNumberEnabled)
          Specifies whether process of obtaining licenses by Serial Number should be enabled.
 void setGetEnabled(boolean aGetEnabled)
           
static void setLogger(com.jp.protection.utils.ProtectionLogger aLogger)
           
 void setLogin(java.lang.String aLogin)
          Specifies login name
 void setPassword(java.lang.String aPassword)
          Specifies password used by default to decide whether it is possible to execute any of the LicensingFacade methods
 void setReadProtectionPassword(java.lang.String aReadProtectionPassword)
           
 void setVersion(java.lang.String aVersion)
          Specifies version information
protected  void unableToReadLicenseError()
           
 byte[] writeLicense(License aLicense)
          Writes license to array of bytes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

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

SUB_VERSION

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

fDefaultDeliveryType

protected int fDefaultDeliveryType

fCommercialEnabled

protected boolean fCommercialEnabled

fEvaluationEnabled

protected boolean fEvaluationEnabled

fExtEvaluationEnabled

protected boolean fExtEvaluationEnabled

fGetBySerialNumberEnabled

protected boolean fGetBySerialNumberEnabled

fGetEnabled

protected boolean fGetEnabled

fGetByDescrEnabled

protected boolean fGetByDescrEnabled

fActivateLicenseEnabled

protected boolean fActivateLicenseEnabled

fDeactivateLicenseEnabled

protected boolean fDeactivateLicenseEnabled

fLogin

protected java.lang.String fLogin

fPassword

protected java.lang.String fPassword

fVersion

protected java.lang.String fVersion

fLicenseWriterFacade

protected LicenseWriterFacade fLicenseWriterFacade

fLicenseReaderFacade

protected LicenseReaderFacade fLicenseReaderFacade

fDelegate

protected LicensingFacadeDelegate fDelegate

fExtension

protected LicensingFacadeExtension fExtension

LOGGER_NAME

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

fProtectionLogger

protected static com.jp.protection.utils.ProtectionLogger fProtectionLogger

fLogLevel

protected static int fLogLevel

fDeliveryMap

protected java.util.HashMap fDeliveryMap

fLicensingFacadeConfig

protected LicensingFacadeConfig fLicensingFacadeConfig

fPluginFactoryMap

protected static java.util.Map fPluginFactoryMap

fReadProtectionPassword

protected java.lang.String fReadProtectionPassword
Constructor Detail

LocalLicensingFacade

public LocalLicensingFacade()
Creates new instance of the LocalLicensingFacade


LocalLicensingFacade

public LocalLicensingFacade(java.io.InputStream aProductsStorageInputStream)
                     throws java.io.IOException
Creates new instance of the LocalLicensingFacade and loads products storage from the specified input stream.

Parameters:
aProductsStorageInputStream - input stream to load products storage from
Throws:
java.io.IOException - in case of any errors during products storage load process

LocalLicensingFacade

public LocalLicensingFacade(java.io.File aProductsStorageFile)
                     throws java.io.IOException
Creates new instance of the LocalLicensingFacade and loads products storage from the specified local file.

Parameters:
aProductsStorageFile - local file to load products storage from
Throws:
java.io.IOException - in case of any errors during products storage load process
Method Detail

getAPIVersion

public static java.lang.String getAPIVersion()

init

public void init(java.io.InputStream aProductsStorageInputStream)
          throws java.io.IOException
Initialize an instance of the LocalLicensingFacade and loads products storage from the specified input stream.

Parameters:
aProductsStorageInputStream - input stream to load products storage from
Throws:
java.io.IOException - in case of any errors during products storage load process

init

public void init(java.io.File aProductsStorageFile)
          throws java.io.IOException
Initialize an instance of the LocalLicensingFacade and loads products storage from the specified local file.

Parameters:
aProductsStorageFile - local file to load products storage from
Throws:
java.io.IOException - in case of any errors during products storage load process

getProductsStorage

public ProductsStorage getProductsStorage()
Returns products storage that this class is working with

Returns:
products storage

getDelegate

public LicensingFacadeDelegate getDelegate()
Returns 'delegate' plug-in used by this class to delegate all LicensingFacade functionality to

Returns:
a LicensingFacadeDelegate instance

setDelegate

public void setDelegate(LicensingFacadeDelegate aLocalLicensingFacadeDelegate)
Specifies 'delegate' plug-in used by this class to delegate all LicensingFacade functionality to

Parameters:
aLocalLicensingFacadeDelegate - a LicensingFacadeDelegate instance

getLicenseReaderFacade

public LicenseReaderFacade getLicenseReaderFacade()
Returns license reader facade used to read licenses

Returns:
license reader facade

getLicenseWriterFacade

public LicenseWriterFacade getLicenseWriterFacade()
Returns license writer facade used to write licenses

Returns:
license writer facade

getExtension

public LicensingFacadeExtension getExtension()
Returns 'extension' plug-in used to extends the functionality of the class

Returns:
LicensingFacadeExtension

setExtension

public void setExtension(LicensingFacadeExtension aLocalLicensingFacadeExtension)
Specifies 'extension' plug-in used to extend the functionality of the class

Parameters:
aLocalLicensingFacadeExtension - a LicensingFacadeExtension instance

checkActivateLicenseEnabled

public boolean checkActivateLicenseEnabled(LicensingFacadeSession aSession,
                                           LicenseBase aLicenseInfo)
Checks whether license activation is enabled. If extension is specified then it calls extension's checkActivateLicenseEnabled(null) method else it returns value specified by the call of the setActivateLicenseEnabled() method

Parameters:
aSession - a session object obtained as the result of the login() method call.
aLicenseInfo - license information to activate
Returns:
true if license activation is enabled; false otherwise

checkDeactivateLicenseEnabled

public boolean checkDeactivateLicenseEnabled(LicensingFacadeSession aSession,
                                             LicenseBase aLicenseInfo)
Checks whether license deactivation is enabled. If extension is specified then it calls extension's checkDeactivateLicenseEnabled(null) method else it returns value specified by the call of the setDeactivateLicenseEnabled() method

Parameters:
aSession - a session object obtained as the result of the login() method call.
aLicenseInfo - license information to deactivate
Returns:
true if license deactivation is enabled; false otherwise

isDeactivateLicenseEnabled

public boolean isDeactivateLicenseEnabled()

setDeactivateLicenseEnabled

public void setDeactivateLicenseEnabled(boolean aDeactivateLicenseEnabled)

isActivateLicenseEnabled

public boolean isActivateLicenseEnabled()
Returns whether license activation is enabled.

Returns:
true if license activation is enabled; false otherwise

setActivateLicenseEnabled

public void setActivateLicenseEnabled(boolean aActivateLicenseEnabled)
Specifies whether license activation should be enabled.

Parameters:
aActivateLicenseEnabled - enable value

isCommercialEnabled

public boolean isCommercialEnabled()
Returns whether process of obtaining commercial licenses is enabled.

Returns:
true if process of obtaining commercial licenses is enabled; false otherwise

setCommercialEnabled

public void setCommercialEnabled(boolean aCommercialEnabled)
Specifies whether process of obtaining commercial licenses should be enabled.

Parameters:
aCommercialEnabled - enable value

isGetByDescrEnabled

public boolean isGetByDescrEnabled()

setGetByDescrEnabled

public void setGetByDescrEnabled(boolean aGetByDescrEnabled)

isGetEnabled

public boolean isGetEnabled()

setGetEnabled

public void setGetEnabled(boolean aGetEnabled)

isGetBySerialNumberEnabled

public boolean isGetBySerialNumberEnabled()
Returns whether process of obtaining licenses by Serial Number is enabled.

Returns:
true if process of obtaining commercial licenses by Serial Number is enabled; false otherwise

setGetBySerialNumberEnabled

public void setGetBySerialNumberEnabled(boolean aGetBySerialNumberEnabled)
Specifies whether process of obtaining licenses by Serial Number should be enabled.

Parameters:
aGetBySerialNumberEnabled - enabled value

isEvaluationEnabled

public boolean isEvaluationEnabled()
Returns whether process of obtaining evaluation licenses is enabled.

Returns:
true if getting of evaluation licenses is enabled; false otherwise

setEvaluationEnabled

public void setEvaluationEnabled(boolean aEvaluationEnabled)
Specifies whether process of obtaining evaluation licenses should be enabled.

Parameters:
aEvaluationEnabled - enable value

getPassword

public java.lang.String getPassword()
Returns password

Returns:
password

setPassword

public void setPassword(java.lang.String aPassword)
Specifies password used by default to decide whether it is possible to execute any of the LicensingFacade methods

Parameters:
aPassword - password

isExtEvaluationEnabled

public boolean isExtEvaluationEnabled()
Returns whether process of obtaining extended evaluation licenses is enabled.

Returns:
true if process of obtaining extended evaluation licenses is enabled; false otherwise

setExtEvaluationEnabled

public void setExtEvaluationEnabled(boolean aExtEvaluationEnabled)
Specifies whether process of obtaining extended evaluation licenses should be enabled.

Parameters:
aExtEvaluationEnabled - enable value

generateLicenseNumber

protected java.lang.String generateLicenseNumber(LicenseBase aLicenseInfo,
                                                 dev.entities.Customer aCustomer)

loginFailedError

protected LicensingFacadeResult loginFailedError(java.lang.String aLogin,
                                                 java.lang.String aPassword)

notAllowedError

protected LicensingFacadeResult notAllowedError(java.lang.String anAccessType)

notEligibleError

protected LicensingFacadeResult notEligibleError()

sendByEmail

protected LicensingFacadeResult sendByEmail(byte[] aLicenseBytes,
                                            dev.entities.Customer aCustomer)

getSerialNumber

protected java.lang.String getSerialNumber(LicenseBase aLicenseInfo)

login

protected LicensingFacadeSession login(LicenseBase aLicenseInfo,
                                       java.lang.String aLogin,
                                       java.lang.String aPassword,
                                       java.util.Map anArguments,
                                       int anOperation)

isLoginEnabled

public boolean isLoginEnabled(LicenseBase aLicenseInfo,
                              java.lang.String aLogin,
                              java.lang.String aPassword)
Checks whether login information is correct and it is possible to execute the LicensingFacade methods

Parameters:
aLicenseInfo - license information
aLogin - login name
aPassword - password
Returns:
true if login information is correct and it is possible to execute the LicensingFacade methods; otherwise

setLogger

public static void setLogger(com.jp.protection.utils.ProtectionLogger aLogger)

getLogger

public static com.jp.protection.utils.ProtectionLogger getLogger()

log

public void log(LicensingFacadeSession aSession)

log

public void log(LicensingFacadeResultBase aResult)

createLicense

protected LicenseImpl createLicense(LicensingFacadeSession aSession,
                                    LicenseBase aLicenseInfo,
                                    dev.entities.Customer aCustomer)

createLicense

protected LicenseImpl createLicense(java.lang.String aSerialNumber)
                             throws SerialNumberException
Throws:
SerialNumberException

createLicense

protected LicenseImpl createLicense(LicenseDescr aLicenseDescr,
                                    dev.entities.Customer aCustomer)

getLicense

public LicensingFacadeResult getLicense(LicenseDescr aLicenseDescr,
                                        dev.entities.Customer aCustomer,
                                        java.lang.String aLogin,
                                        java.lang.String aPassword,
                                        java.util.Map anArguments)
Description copied from interface: LicensingFacade
Generates a license according to the provided license descriptor. Valid login and password values should be specified to ensure that the user is eligible to get or activate certain type of license. This method is intended to be used by customers' applications to get evaluation licenses. It's quite safe to use as it allows to define only basic license attributes; exact license attributes will be specified by backend.

Specified by:
getLicense in interface LicensingFacade
Parameters:
aLicenseDescr - describes license to get
aCustomer - specifies customer information, which requests a license
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license getting
Returns:
a LicensingFacadeResult instance.

getLicense

public LicensingFacadeResult getLicense(LicenseInfo aLicenseInfo,
                                        dev.entities.Customer aCustomer,
                                        java.lang.String aLogin,
                                        java.lang.String aPassword,
                                        java.util.Map anArguments)
Description copied from interface: LicensingFacade
Generates a license according to provided license information. Valid login and password values should be specified to ensure that the user is eligible to get or activate certain type of license. This method is intended for internal vendors' use e.g. delivering licenses using Control Center or allowing stores/resellers to generate licenses according to all specified attributes. In most of cases it should be never used by custom applications as it provides too much potential control over licenses generation.

Specified by:
getLicense in interface LicensingFacade
Parameters:
aLicenseInfo - describes license to get
aCustomer - specifies customer information, which requests a license
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license getting
Returns:
a LicensingFacadeResult instance.

putActivationKey

protected void putActivationKey(LicenseImpl aLicense,
                                java.util.Map anArguments)

getLicense

public LicensingFacadeResult getLicense(java.lang.String aSerialNumber,
                                        dev.entities.Customer aCustomer,
                                        java.lang.String aLogin,
                                        java.lang.String aPassword,
                                        java.util.Map anArguments)
Description copied from interface: LicensingFacade
Generates a license according to the provided Serial Number. Valid login and password values should be specified to ensure that the user is eligible to get or activate certain type of license.

Specified by:
getLicense in interface LicensingFacade
Parameters:
aSerialNumber - serial number
aCustomer - specifies customer information, which requests a license
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license getting
Returns:
a LicensingFacadeResult instance.

unableToReadLicenseError

protected void unableToReadLicenseError()

activateLicense

public LicensingFacadeResult activateLicense(byte[] aLicenseBytes,
                                             dev.entities.Customer aCustomer,
                                             java.lang.String anActivationKey,
                                             java.lang.String aLogin,
                                             java.lang.String aPassword,
                                             java.util.Map anArguments)
Description copied from interface: LicensingFacade
Activates a license specified as an array of bytes. Valid login and password values should be specified to ensure that the user is eligible to activate certain type of license.

Specified by:
activateLicense in interface LicensingFacade
Parameters:
aLicenseBytes - license to activate passed as array of bytes
aCustomer - specifies customer information, which requests a license
anActivationKey - activation key
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license activation
Returns:
a LicensingFacadeResult instance.

lsLicenseProperlyDeactivated

public boolean lsLicenseProperlyDeactivated(java.lang.String aProductID,
                                            java.lang.String anActivationKey,
                                            java.lang.String aDeactivationKey)

deactivateLicense

public LicensingFacadeResult deactivateLicense(byte[] aLicenseBytes,
                                               java.lang.String aDeactivationKey,
                                               java.lang.String aLogin,
                                               java.lang.String aPassword,
                                               java.util.Map anArguments)
Description copied from interface: LicensingFacade
Deactivates a license at the vendors side. The license should be previously deactivated at the customers side by call of LicenseHostPro.deactivateLicense() Valid login and password values should be specified to ensure that the user is eligible to activate certain type of license.

Specified by:
deactivateLicense in interface LicensingFacade
Parameters:
aLicenseBytes - license to deactivate passed as array of bytes
aDeactivationKey - deactivation key returned by LicenseHostPro.deactivateLicense() call
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license deactivation
Returns:
a LicensingFacadeResult instance.

getLicensingFacadeResult

protected LicensingFacadeResult getLicensingFacadeResult(LicensingFacadeSession aSession,
                                                         LicensingFacadeResultBase anExtensionResult,
                                                         License aLicense,
                                                         dev.entities.Customer aCustomer)

checkGetLicenseEnabled

protected boolean checkGetLicenseEnabled(LicensingFacadeSession aSession,
                                         LicenseBase aLicenseInfo)

isSerialNumberOrigin

public static boolean isSerialNumberOrigin(LicenseBase aLicenseInfo)

isGetLicenseEnabled

public boolean isGetLicenseEnabled(LicensingFacadeSession aSession,
                                   LicenseBase aLicenseInfo)
Returns whether ability of obtaining licenses of a certain type (specified by supplied license information) is enabled

Parameters:
aSession - session
aLicenseInfo - license information
Returns:
true if ability of obtaining licenses of a certain type is enabled; false otherwise

getLicenseBytes

protected byte[] getLicenseBytes(LicensingFacadeSession aSession,
                                 LicenseBase aLicenseInfo,
                                 dev.entities.Customer aCustomer)

writeLicense

public byte[] writeLicense(License aLicense)
Writes license to array of bytes

Parameters:
aLicense - license to write
Returns:
array of bytes that represents license

getLogin

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

Returns:
login name

setLogin

public void setLogin(java.lang.String aLogin)
Specifies login name

Parameters:
aLogin - login name

getVersion

public java.lang.String getVersion()
Description copied from interface: LicensingFacade
Returns the version of implementation. Can be useful to avoid improper deployment issues.

Specified by:
getVersion in interface LicensingFacade
Returns:
version information

setVersion

public void setVersion(java.lang.String aVersion)
Specifies version information

Parameters:
aVersion - version information

getDelivery

public LicensingFacadeDelivery getDelivery(int aDeliveryType)
Returns registered delivery object for the specified delivery type

Parameters:
aDeliveryType - delivery type
Returns:
in instance of LicensingFacadeDelivery

addDelivery

public void addDelivery(int aDeliveryType,
                        LicensingFacadeDelivery aDelivery)
Registers delivery object for certain delivery type

Parameters:
aDeliveryType - delivery type
aDelivery - delivery object to register

removeDelivery

public LicensingFacadeDelivery removeDelivery(int aDeliveryType)
Unregisters delivery object for certain delivery type

Parameters:
aDeliveryType - delivery type
Returns:
LicensingFacadeDelivery delivery object that has been unregistered (if any)

getDefaultDeliveryType

public int getDefaultDeliveryType()
Returns default delivery type

Returns:
delivery type

setDefaultDeliveryType

public void setDefaultDeliveryType(int aDefaultDeliveryType)
Specifies default delivery type

Parameters:
aDefaultDeliveryType - delivery type

getLicensingFacadeConfig

public LicensingFacadeConfig getLicensingFacadeConfig()
Returns configuration specified for this object

Returns:
an instance of the LicensingFacadeConfig

init

public void init(LicensingFacadeConfig aLicensingFacadeConfig,
                 java.lang.Class aBaseClass)
Provides initialization according to the specified configuration

Parameters:
aLicensingFacadeConfig - configuration
aBaseClass - base class to load products storage

initPlugin

protected void initPlugin()

getPluginFactory

protected LicensingFacadePluginFactory getPluginFactory()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getPluginFactory

public static LicensingFacadePluginFactory getPluginFactory(java.lang.String aPluginFactoryClassName)

closePluginFactory

public static void closePluginFactory(java.lang.String aPluginFactoryClassName)

closePluginFactories

public static void closePluginFactories()

getDeactivationKey

public java.lang.String getDeactivationKey(java.lang.String aProductID,
                                           java.lang.String anActivationKey,
                                           boolean isCompleted,
                                           boolean isStrippedActivationKeyChars)

getDeactivationKey

public static final java.lang.String getDeactivationKey(Product aProduct,
                                                        java.lang.String anActivationKey,
                                                        boolean isCompleted,
                                                        boolean isStrippedActivationKeyChars)

resolvePassword

public java.lang.String resolvePassword()
Specified by:
resolvePassword in interface ProductsStorage.PasswordResolver

passwordMismatch

public void passwordMismatch()
Specified by:
passwordMismatch in interface ProductsStorage.PasswordResolver

getReadProtectionPassword

public java.lang.String getReadProtectionPassword()

setReadProtectionPassword

public void setReadProtectionPassword(java.lang.String aReadProtectionPassword)