com.jp.protection.priv.pro.integration
Interface LicensingFacadeExtension

All Superinterfaces:
LicensingFacadePlugin
All Known Implementing Classes:
LicensingFacadeExtensionSupport

public interface LicensingFacadeExtension
extends LicensingFacadePlugin

This interface provides methods required to extend the LocalLicensingFacade functionality.

Local licensing facade calls extension's method in the following sequence during the license acquisition:

  1. login(...)
  2. checkGetLicenseEnabled(...)
  3. onGetLicense(...)
  4. deliver(...)

Local licensing facade calls extension's method in the following sequence during the license activation:
  1. login(...)
  2. checkActivateLicenseEnabled(...)
  3. onActivateLicense(...)
  4. deliver(...)
Note that execution stopped if any method calls are failed.


Method Summary
 boolean checkActivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Checks whether it is possible to activate license.
 boolean checkDeactivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Checks whether it is possible to deactivate license.
 boolean checkGetLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
          Checks whether it is possible to get licenses according to the specified license information
 LicensingFacadeResult deliver(LicensingFacadeSession aSession, int aDeliveryType, License aLicense, dev.entities.Customer aCustomer)
          Delivers license to the customer.
 LicensingFacadeSession login(LicenseBase aLicenseInfo, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments, int anOperation)
          Authenticates and authorizes attempt to get or activate license.
 LicensingFacadeResultBase onActivateLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, java.lang.String anActivationKey)
          This method allows inclusion into the process of license activation.
 LicensingFacadeResultBase onDeactivateLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, java.lang.String aDeactivationKey, boolean isSuccess)
          This method allows inclusion into the process of license deactivation.
 LicensingFacadeResultBase onGetLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer)
          This method allows inclusion into the process of the license generation.
 
Methods inherited from interface com.jp.protection.priv.pro.integration.LicensingFacadePlugin
init
 

Method Detail

login

LicensingFacadeSession login(LicenseBase aLicenseInfo,
                             java.lang.String aLogin,
                             java.lang.String aPassword,
                             java.util.Map anArguments,
                             int anOperation)
Authenticates and authorizes attempt to get or activate license. Caller credentials (login and password) should be checked to ensure that the caller is known to the system. License information should be used to ensure that the caller has rights to get or activate certain type of license.

Parameters:
aLicenseInfo - license information
aLogin - login name
aPassword - password
anArguments - additional arguments can be needed for proper license getting or activation
anOperation - operation as one of LicensingFacadeSession.OPERATION_ constants
Returns:
a session object that by default holds specified login, arguments and operation. Custom implementations can return custom session objects that could carry out any additional information. Returns null if caller has no rights to get or activate certain type of license.

checkGetLicenseEnabled

boolean checkGetLicenseEnabled(LicensingFacadeSession aSession,
                               LicenseBase aLicenseInfo)
Checks whether it is possible to get licenses according to the specified license information

Parameters:
aSession - a session object obtained as result of login() method call.
aLicenseInfo - license information
Returns:
true if it is possible to get license according to specified license information. false otherwise.

checkActivateLicenseEnabled

boolean checkActivateLicenseEnabled(LicensingFacadeSession aSession,
                                    LicenseBase aLicenseInfo)
Checks whether it is possible to activate license.

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

checkDeactivateLicenseEnabled

boolean checkDeactivateLicenseEnabled(LicensingFacadeSession aSession,
                                      LicenseBase aLicenseInfo)
Checks whether it is possible to deactivate license.

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

onGetLicense

LicensingFacadeResultBase onGetLicense(LicensingFacadeSession aSession,
                                       LicenseImpl aLicense,
                                       dev.entities.Customer aCustomer)
This method allows inclusion into the process of the license generation. Implementation of the method can:

Parameters:
aSession - a session object obtained as result of login() method call.
aLicense - a license to be generated
aCustomer - customer information
Returns:
an LicensingFacadeResultBase instance

onActivateLicense

LicensingFacadeResultBase onActivateLicense(LicensingFacadeSession aSession,
                                            LicenseImpl aLicense,
                                            dev.entities.Customer aCustomer,
                                            java.lang.String anActivationKey)
This method allows inclusion into the process of license activation. Implementation of the method can:

Parameters:
aSession - a session object obtained as result of login() method call.
aLicense - a license to be activated
aCustomer - customer information
anActivationKey - activation key
Returns:
an LicensingFacadeResultBase instance

onDeactivateLicense

LicensingFacadeResultBase onDeactivateLicense(LicensingFacadeSession aSession,
                                              LicenseImpl aLicense,
                                              java.lang.String aDeactivationKey,
                                              boolean isSuccess)
This method allows inclusion into the process of license deactivation. Implementation of the method should take care about making proper steps to remove previous activation records to allow further license activation on another computer

Parameters:
aSession - a session object obtained as result of login() method call.
aLicense - a license to be deactivated
aDeactivationKey - deactivation key
isSuccess - specifies whether license has been actually deactivated on the client side
Returns:
an LicensingFacadeResultBase instance

deliver

LicensingFacadeResult deliver(LicensingFacadeSession aSession,
                              int aDeliveryType,
                              License aLicense,
                              dev.entities.Customer aCustomer)
Delivers license to the customer. Method implementation should write license to an array of bytes and assign it to the method's result for an online delivery type. For other delivery types license should be distributed to the user by some other methods (e.g. by sending license as an attachment to the e-mail message). In such case meaningful message should be specified for the method's result to instruct the user on how to find delivered license (e.g. "Please check your mailbox for a license")

Parameters:
aSession - a session object obtained as result of login() method call.
aDeliveryType - type of license delivery. Can be one of LicensingFacadeResult.DELIVERY_TYPE constants or any custom value known for particular implementation
aLicense - a license to be delivered
aCustomer - Customer customer information
Returns:
LicensingFacadeResult LicensingFacadeResult instance