|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jp.protection.pub.LicenseAdapter
com.jp.protection.pub.pro.LicensingServiceSupport
public class LicensingServiceSupport
Utility class that encapsulates all the code required to connect and work with the Licensing Server. An instance of this class is used by the Licensing Assistant and the License Host providing support for getting licenses and handling of concurrent user models.
| Field Summary | |
|---|---|
protected boolean |
fAcquireMACAddress
|
protected LicensingServiceResult |
fConfirmLockResult
|
protected LicenseHostPro |
fLicenseHost
|
protected java.lang.String |
fLicensingServerAddress
|
protected LicensingService |
fLicensingService
|
protected LicensingServiceProvider |
fLicensingServiceProvider
|
protected LicensingServiceProviderListener |
fLicensingServiceProviderListener
|
protected LicensingServiceResult |
fLockResult
|
protected LicensingServiceResult |
fObtainLicenseResult
|
protected java.lang.String |
fProviderName
|
protected java.lang.Thread |
fShutdownHook
|
protected LicensingServiceResult |
fUnlockLicenseResult
|
| Fields inherited from class com.jp.protection.pub.LicenseAdapter |
|---|
fVerbose |
| Constructor Summary | |
|---|---|
LicensingServiceSupport(LicenseHostPro aLicenseHost)
Creates a new instance of given License Host |
|
| Method Summary | |
|---|---|
LicensingServiceResult |
canLockLicense()
Query the Licensing Server to check whether license lock can be acquired |
LicensingService |
createLicensingService(LicensingServiceProvider aLicensingServiceProvider)
Creates a new instance of Licensing Service using specified provider |
LicensingServiceProvider |
createLicensingServiceProvider(java.lang.String aLicensingServerAddress)
Creates a new instance Licensing Service Provider for the given address |
static LicenseData.Request |
createRequest(ProductInfo aProductInfo)
Creates request for given product information |
static LicensingServiceResult |
createResult(java.lang.RuntimeException ex)
Creates result object for given exception |
protected void |
error(java.lang.String aMessage)
|
protected void |
error(java.lang.Throwable ex)
|
LicensingServiceResult |
getConfirmLockResult()
Returns result of last license lock confirm operation |
java.lang.String |
getLicensingServerAddress()
Returns address of the Licensing Server used when no corresponding address is specified for the license |
LicensingService |
getLicensingService()
Returns cached Licensing Service instance |
LicensingService |
getLicensingService(boolean aForceCreate)
Returns cached Licensing Service instance |
protected LicensingServiceProvider |
getLicensingServiceProvider()
|
LicensingServiceResult |
getLockResult()
Returns result of last license lock operation |
byte[] |
getObtainedLicenseBytes()
Returns license bytes obtained during last obtainLicense(...) call |
LicensingServiceResult |
getObtainLicenseResult()
Returns result of last obtain license operation |
java.lang.String |
getProviderName()
Returns name of the Licensing Service Provider to use |
LicensingServiceResult |
getUnlockLicenseResult()
Return result of last unlock license operation |
static java.lang.String |
getUserMessage(java.lang.Throwable ex)
Compose message can be shown to the end user for the given exception |
boolean |
hasLicensingServiceProvider()
Checks whether Licensing Service Provider is already created |
boolean |
isAcquireMACAddress()
Returns whether MAC address(es) of the network card(s) must be acquired during composing requests for the Licensing Server |
boolean |
isLicensingServerAddressKnown()
Returns if Licensing Server address is specified for the license |
boolean |
isLockExpired()
Returns whether license lock is already expired. |
boolean |
isLockOK()
Returns whether license lock is OK: license is locked and lock is neither expired nor revoked. |
boolean |
isLockRevoked()
Returns whether license lock revocation has been requested by the administrator. |
void |
licenseAboutToRead(LicenseReader aSource,
java.lang.String aProductID)
Releases all the resources when new license is about to read. |
boolean |
lockLicense(boolean isForceLock)
Acquires license lock using the Licensing Server. |
boolean |
obtainLicense(LicensingService aLicensingService,
ProductInfo aProductInfo)
Obtains a license identified by the product information from the Licensing Server. |
boolean |
obtainLicense(java.lang.String aServerAddress,
ProductInfo aProductInfo)
Obtains a license identified by the product information from the Licensing Server. |
void |
release()
Releases all the acquired resources including Licensing Service provider, Licensing Service services and license locks |
void |
release(boolean isShutdown)
Releases all the acquired resources including Licensing Service provider, Licensing Service services and license locks |
void |
setAcquireMACAddress(boolean aAcquireMACAddress)
Specifies that MAC address(es) of the network card(s) must be acquired during composing requests for the Licensing Server |
void |
setLicensingServerAddress(java.lang.String aLicensingServerAddress)
Specifies address of the Licensing Server should be used when no corresponding address is specified for the license. |
void |
setLockResult(LicensingServiceResult aLockResult)
Specifies result of last license lock operation |
void |
setProviderName(java.lang.String aProviderName)
Specifies the name of the Licensing Service Provider to use |
boolean |
unlockLicense()
Releases license lock |
| Methods inherited from class com.jp.protection.pub.LicenseAdapter |
|---|
featureChecked, isVerbose, licenseAboutToExpire, licenseAccepted, licenseAvailable, licenseCorrupted, licenseExpired, licenseInvalid, licenseLockExpired, licenseLockRevoked, licenseLockViolation, licenseMissing, licenseNeedActivation, licenseNeedLock, licenseNotActivated, licenseNotLocked, licenseOk, licenseUseLimitAboutReach, message, numberCopiesViolation, setVerbose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected LicenseHostPro fLicenseHost
protected java.lang.String fProviderName
protected LicensingServiceProvider fLicensingServiceProvider
protected LicensingService fLicensingService
protected java.lang.Thread fShutdownHook
protected java.lang.String fLicensingServerAddress
protected LicensingServiceProviderListener fLicensingServiceProviderListener
protected LicensingServiceResult fObtainLicenseResult
protected LicensingServiceResult fLockResult
protected LicensingServiceResult fConfirmLockResult
protected LicensingServiceResult fUnlockLicenseResult
protected boolean fAcquireMACAddress
| Constructor Detail |
|---|
public LicensingServiceSupport(LicenseHostPro aLicenseHost)
aLicenseHost - License Host| Method Detail |
|---|
public void licenseAboutToRead(LicenseReader aSource,
java.lang.String aProductID)
licenseAboutToRead in interface LicenseReaderListenerlicenseAboutToRead in class LicenseAdapteraSource - the license reader.aProductID - ID of the product this license is issued for.public java.lang.String getProviderName()
public void setProviderName(java.lang.String aProviderName)
aProviderName - name of the Licensing Service Providerpublic java.lang.String getLicensingServerAddress()
public void setLicensingServerAddress(java.lang.String aLicensingServerAddress)
aLicensingServerAddress - address of the Licensing Serverpublic boolean isLicensingServerAddressKnown()
true if Licensing Server address is specified for the license; false otherwisepublic boolean hasLicensingServiceProvider()
true if Licensing Service Provider is already created; false otherwisepublic LicensingServiceProvider createLicensingServiceProvider(java.lang.String aLicensingServerAddress)
aLicensingServerAddress - address of the Licensing Server
public LicensingService createLicensingService(LicensingServiceProvider aLicensingServiceProvider)
aLicensingServiceProvider - Licensing Service Provider used to create Licensing Service
protected LicensingServiceProvider getLicensingServiceProvider()
public LicensingServiceResult getLockResult()
public LicensingServiceResult getConfirmLockResult()
public LicensingServiceResult getObtainLicenseResult()
public void setLockResult(LicensingServiceResult aLockResult)
aLockResult - result of last license lock operationpublic static LicenseData.Request createRequest(ProductInfo aProductInfo)
aProductInfo - product information
public boolean lockLicense(boolean isForceLock)
isForceLock - specifies whether license lock should be re-acquired.
true if license lock is acquired; false otherwise. Full result of the
operation can be obtained by the getLockResult() call.
public boolean obtainLicense(java.lang.String aServerAddress,
ProductInfo aProductInfo)
aServerAddress - Licensing Server address to obtain a license fromaProductInfo - product information identifies a license to obtain
true if license is obtained; false otherwise.
Full result of the operation can be obtained by a getObtainLicenseResult() call and
license bytes for the license can be got by a getObtainedLicenseBytes() call.
public boolean obtainLicense(LicensingService aLicensingService,
ProductInfo aProductInfo)
aLicensingService - instance of the Licensing Service to useaProductInfo - product information identifies a license to obtain
true if license is obtained; false otherwise.
Full result of the operation can be obtained by a getObtainLicenseResult() call and
license bytes for the license can be got by a getObtainedLicenseBytes() call.public byte[] getObtainedLicenseBytes()
obtainLicense(...) call
public static LicensingServiceResult createResult(java.lang.RuntimeException ex)
ex - exception to get result object for
public LicensingServiceResult canLockLicense()
public boolean isLockOK()
true if license lock is OK; false otherwise.public boolean isLockRevoked()
true if license lock revocation has been requested; false otherwise.public boolean isLockExpired()
true if license lock is already expired; false otherwise.public boolean unlockLicense()
true if license lock released; false otherwise. Full result of the
operation can be obtained by the getUnlockLicenseResult() call.public LicensingServiceResult getUnlockLicenseResult()
public boolean isAcquireMACAddress()
true if MAC address(es) must be acquired; false otherwisepublic void setAcquireMACAddress(boolean aAcquireMACAddress)
aAcquireMACAddress - true if MAC address(es) must be acquired; false otherwisepublic LicensingService getLicensingService()
public LicensingService getLicensingService(boolean aForceCreate)
aForceCreate - specifies that cached instance (if any) must be recreated
public static java.lang.String getUserMessage(java.lang.Throwable ex)
ex - exceptions to compose message for
protected void error(java.lang.String aMessage)
error in class LicenseAdapterprotected void error(java.lang.Throwable ex)
public void release(boolean isShutdown)
isShutdown - identifies whether release is called during the application shutdown (exit).public void release()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||