|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.priv.pro.integration.LicensingFacadeExtensionSupport
public abstract class LicensingFacadeExtensionSupport
This class provides basic implementation of the LicensingFacadeExtension
interface that
can be used to build actual implementations
Field Summary | |
---|---|
protected LocalLicensingFacade |
fLocalLicensingFacade
|
static java.lang.String |
MSG_ID_ALREADY_ACTIVATED
|
static java.lang.String |
MSG_ID_ALREADY_DEACTIVATED
|
static java.lang.String |
MSG_ID_ALREADY_ISSUED
|
static java.lang.String |
MSG_ID_NOT_PROPERLY_DEACTIVATED
|
static java.lang.String |
MSG_ID_NUMBER_COPIES_EXCEEDED
|
(package private) static java.util.ResourceBundle |
res
|
(package private) static java.lang.String |
RESOURCE_BUNDLE_NAME
|
Constructor Summary | |
---|---|
LicensingFacadeExtensionSupport()
|
Method Summary | |
---|---|
void |
acquireConnection()
Acquires connection (e.g. |
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. |
void |
commit()
Commits changes made during this session |
void |
commit(LicensingFacadeSession aSession)
Commits changes made during this session by calling the commit() method |
LicensingFacadeResult |
deliver(LicensingFacadeSession aSession,
int aDeliveryType,
License aLicense,
dev.entities.Customer aCustomer)
Delivers license to the customer. |
int |
getDeliveryType(LicensingFacadeSession aSession,
LicenseImpl aLicense,
dev.entities.Customer aCustomer)
Returns delivery type for the given arguments |
protected static java.util.Locale |
getLocale(java.lang.String aLocale)
|
protected static java.lang.String |
getLocalizedMessage(java.lang.String aMessageID,
LicensingFacadeSession aSession)
|
protected static java.lang.String |
getLocalizedMessage(java.lang.String aBundleName,
java.lang.String aMessageID,
java.lang.String aLocale)
|
LocalLicensingFacade |
getLocalLicensingFacade()
Returns local licensing facade this extension is working for |
protected com.jp.protection.utils.ProtectionLogger |
getLogger()
|
void |
init(LocalLicensingFacade aLicensingFacade)
Initializes plug-in. |
abstract boolean |
isLicenseAlreadyActivated(LicensingFacadeSession aSession,
LicenseImpl aLicense,
dev.entities.Customer aCustomer,
java.lang.String anActivationKey,
java.lang.StringBuffer aMessage)
Checks whether requested license is already activated for particular customer. |
abstract boolean |
isLicenseAlreadyDeactivated(LicensingFacadeSession aSession,
LicenseImpl aLicense,
java.lang.StringBuffer aMessage)
Checks whether requested license is already deactivated. |
abstract boolean |
isLicenseAlreadyIssued(LicensingFacadeSession aSession,
LicenseImpl aLicense,
dev.entities.Customer aCustomer,
java.lang.StringBuffer aMessage)
Checks whether requested license is already issued for particular customer. |
abstract void |
logActivatedLicense(LicensingFacadeSession aSession,
LicenseImpl aLicense,
dev.entities.Customer aCustomer,
java.lang.String anActivationKey,
boolean isSuccess,
LicensingFacadeResultBase aResult)
Logs activated licence. |
abstract void |
logDeactivatedLicense(LicensingFacadeSession aSession,
LicenseImpl aLicense,
java.lang.String aDeactivationKey,
boolean isSuccess,
LicensingFacadeResultBase aResult)
Logs deactivated licence. |
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 a license. |
abstract void |
logIssuedLicense(LicensingFacadeSession aSession,
LicenseImpl aLicense,
dev.entities.Customer aCustomer,
boolean isSuccess,
LicensingFacadeResultBase aResult)
Logs issued licence. |
abstract void |
logLicenseDelivery(LicensingFacadeSession aSession,
int aDeliveryType,
License aLicense,
dev.entities.Customer aCustomer,
LicensingFacadeResult aResult,
boolean isSuccess)
Logs license delivery. |
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. |
void |
releaseConnection()
Releases connection (e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static java.util.ResourceBundle res
static java.lang.String RESOURCE_BUNDLE_NAME
public static final java.lang.String MSG_ID_ALREADY_ACTIVATED
public static final java.lang.String MSG_ID_NUMBER_COPIES_EXCEEDED
public static final java.lang.String MSG_ID_ALREADY_ISSUED
public static final java.lang.String MSG_ID_ALREADY_DEACTIVATED
public static final java.lang.String MSG_ID_NOT_PROPERLY_DEACTIVATED
protected LocalLicensingFacade fLocalLicensingFacade
Constructor Detail |
---|
public LicensingFacadeExtensionSupport()
Method Detail |
---|
protected static java.lang.String getLocalizedMessage(java.lang.String aMessageID, LicensingFacadeSession aSession)
protected static java.lang.String getLocalizedMessage(java.lang.String aBundleName, java.lang.String aMessageID, java.lang.String aLocale)
protected static java.util.Locale getLocale(java.lang.String aLocale)
public LocalLicensingFacade getLocalLicensingFacade()
public void init(LocalLicensingFacade aLicensingFacade)
LicensingFacadePlugin
init
in interface LicensingFacadePlugin
aLicensingFacade
- licensing facade this plug-in will working forpublic LicensingFacadeSession login(LicenseBase aLicenseInfo, java.lang.String aLogin, java.lang.String aPassword, java.util.Map anArguments, int anOperation)
getLocalLicensingFacade().isLoginEnabled(aLicenseInfo, aLogin,
aPassword)
to determine whether it's possible to login.
login
in interface LicensingFacadeExtension
aLicenseInfo
- license informationaLogin
- login nameaPassword
- passwordanArguments
- additional arguments can be needed for proper license getting or activationanOperation
- operation as one of
LicensingFacadeSession.OPERATION_
constants
null
if the caller
has no rights to get or activate certain type of license.protected com.jp.protection.utils.ProtectionLogger getLogger()
public boolean checkGetLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
getLocalLicensingFacade().isGetLicenseEnabled(aLicenseInfo)
result.
checkGetLicenseEnabled
in interface LicensingFacadeExtension
aSession
- a session object obtained as a result of the login()
method call.aLicenseInfo
- license information
true
if it is possible to get license according to the specified license information.
false
otherwise.public boolean checkActivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
getLocalLicensingFacade().isActivateLicenseEnabled()
result.
checkActivateLicenseEnabled
in interface LicensingFacadeExtension
aSession
- a session object obtained as the result of the login()
method call.aLicenseInfo
- license information
true
if it is possible to activate license
false
otherwise.public boolean checkDeactivateLicenseEnabled(LicensingFacadeSession aSession, LicenseBase aLicenseInfo)
getLocalLicensingFacade().isDeactivateLicenseEnabled()
result.
checkDeactivateLicenseEnabled
in interface LicensingFacadeExtension
aSession
- a session object obtained as the result of the login()
method call.aLicenseInfo
- license information
true
if it is possible to deactivate license
false
otherwise.public LicensingFacadeResult deliver(LicensingFacadeSession aSession, int aDeliveryType, License aLicense, dev.entities.Customer aCustomer)
delivery.deliver(aLicense, aCustomer)
result.
deliver
in interface LicensingFacadeExtension
aSession
- a session object obtained as result of the login()
method call.aDeliveryType
- type of license delivery. Can be one of the LicensingFacadeResult.DELIVERY_TYPE
constants or any custom value known for a particular implementationaLicense
- a license to be deliveredaCustomer
- Customer customer information
LicensingFacadeResult
instancepublic abstract void logLicenseDelivery(LicensingFacadeSession aSession, int aDeliveryType, License aLicense, dev.entities.Customer aCustomer, LicensingFacadeResult aResult, boolean isSuccess)
isSuccess
arguments defines whether
license delivery is succeeded.
aSession
- a session object obtained as result of the
login()
method call.aDeliveryType
- delivery typeaLicense
- an issued licenseaCustomer
- Customer customer informationaResult
- result of license deliveryisSuccess
- defines whether delivery is successfulpublic abstract void logIssuedLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, boolean isSuccess, LicensingFacadeResultBase aResult)
isSuccess
arguments defines whether
license is issued or request is rejected.
aSession
- a session object obtained as result of the
login()
method call.aLicense
- an issued licenseaCustomer
- Customer customer informationisSuccess
- defines whether issuing request is successfulaResult
- result of license issuingpublic abstract void logActivatedLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, java.lang.String anActivationKey, boolean isSuccess, LicensingFacadeResultBase aResult)
isSuccess
arguments defines whether license is activated
or request is rejected.
aSession
- a session object obtained as result of the login()
method call.aLicense
- an issued licenseaCustomer
- Customer customer informationanActivationKey
- Activation Key placed to the licenseisSuccess
- defines whether activation request is successfulaResult
- result of license activationpublic abstract void logDeactivatedLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, java.lang.String aDeactivationKey, boolean isSuccess, LicensingFacadeResultBase aResult)
isSuccess
arguments defines whether license is deactivated
or request is rejected.
aSession
- a session object obtained as result of the login()
method call.aLicense
- a license to be deactivatedaDeactivationKey
- Deactivation Key that holds result of deactivation operation on the customers computerisSuccess
- defines whether deactivation request is successfulaResult
- result of license deactivationpublic abstract boolean isLicenseAlreadyIssued(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, java.lang.StringBuffer aMessage)
aSession
- a session object obtained as result of the
login()
method call.aLicense
- a license to be issuedaCustomer
- Customer customer informationaMessage
- string buffer to return a message when license is already issued
true
if license is already issued; false
otherwisepublic abstract boolean isLicenseAlreadyActivated(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, java.lang.String anActivationKey, java.lang.StringBuffer aMessage)
aSession
- a session object obtained as result of the login()
method call.aLicense
- a license to be activatedaCustomer
- Customer customer informationanActivationKey
- Activation KeyaMessage
- string buffer to return a message when license is already activated
true
if license is already activated; false
otherwisepublic LicensingFacadeResultBase onActivateLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer, java.lang.String anActivationKey)
LicensingFacadeExtension
LicensingFacadeResultBase.RESULT_ERROR
for the method result
onActivateLicense
in interface LicensingFacadeExtension
aSession
- a session object obtained as result of login()
method call.aLicense
- a license to be activatedaCustomer
- customer informationanActivationKey
- activation key
LicensingFacadeResultBase
instancepublic LicensingFacadeResultBase onGetLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer)
LicensingFacadeExtension
LicensingFacadeResultBase.RESULT_ERROR
for the method result
onGetLicense
in interface LicensingFacadeExtension
aSession
- a session object obtained as result of login()
method call.aLicense
- a license to be generatedaCustomer
- customer information
LicensingFacadeResultBase
instancepublic int getDeliveryType(LicensingFacadeSession aSession, LicenseImpl aLicense, dev.entities.Customer aCustomer)
aSession
- a session object obtained as result of the login()
method call.aLicense
- a license to be issuedaCustomer
- Customer customer information
public abstract boolean isLicenseAlreadyDeactivated(LicensingFacadeSession aSession, LicenseImpl aLicense, java.lang.StringBuffer aMessage)
aSession
- a session object obtained as result of the login()
method call.aLicense
- a license to be deactivatedaMessage
- string buffer to return a message when license is already issued
true
if license is already deactivated; false
otherwisepublic LicensingFacadeResultBase onDeactivateLicense(LicensingFacadeSession aSession, LicenseImpl aLicense, java.lang.String aDeactivationKey, boolean isSuccess)
LicensingFacadeExtension
onDeactivateLicense
in interface LicensingFacadeExtension
aSession
- a session object obtained as result of login()
method call.aLicense
- a license to be deactivatedaDeactivationKey
- deactivation keyisSuccess
- specifies whether license has been actually deactivated on the client side
LicensingFacadeResultBase
instancepublic void acquireConnection()
public void releaseConnection()
public void commit(LicensingFacadeSession aSession)
commit()
method
aSession
- a session object obtained as result of the login()
method call.public void commit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |