com.vs.ezlicgen
Class EzLicenseFullInfo

java.lang.Object
  |
  +--com.vs.ezlicrun.EzLicenseInfo
        |
        +--com.vs.ezlicgen.EzLicenseFullInfo
All Implemented Interfaces:
java.io.Serializable

public class EzLicenseFullInfo
extends com.vs.ezlicrun.EzLicenseInfo

The class manages the state of the information pertaining to a license key and provides methods to generate and parse a license key, as well as those pertaining to the internal functioning of the license manager itself.

The class is used for key generation as follows:
1. Instantiate this class through its default constructor.
2. Invoke its mutators (and those of its superclass) to provide the information necessary to generate the key.
3. Invoke generateKey() to generate the key.

The class is used for examining an existing license key for display purposes as follows:
1. Instantiate this class through its default constructor.
2. Invoke parseLicenseKey() providing the license key to be parsed.
3. Invoke its accessors to obtain the decomposed parts of the key.

See Also:
Serialized Form

Fields inherited from class com.vs.ezlicrun.EzLicenseInfo
CNC, COOKY, CPU, CST, CUST, ENF, EXP, EZLIC_MODE_CUSTOM_COOKIE, EZLIC_MODE_CUSTOM_KEY, EZLIC_MODE_METERED, EZLIC_MODE_OPTIONS, EZLIC_MODE_TIME, EZLIC_MODEL_SERVER, EZLIC_MODEL_USER, EZLIC_TYPE_SVR_CONC, EZLIC_TYPE_SVR_CPU, EZLIC_TYPE_SVR_MHZ, EZLIC_TYPE_SVR_NMU, EZLIC_TYPE_U_FLOAT, EZLIC_TYPE_U_NODE, EZLIC_TYPE_U_USER, FLT, HST, MHZ, NET, NMU, NUMPIECES, OPT, PROD, QTA, TS, USR, WHEN, WHO
 
Constructor Summary
EzLicenseFullInfo()
           
 
Method Summary
 java.lang.String generateKey(java.lang.String userName)
          Generate license key based on class context that was set up through its mutators.
 java.lang.String generateKey(java.lang.String userName, java.lang.String vendorPasswd, java.lang.String vendorCookie, boolean createConfig)
          NOTE: THIS METHOD IS INTENDED FOR INTERNAL USE BY THE EASYLICENSER VENDOR CODE.
 java.util.Date getCreationDate()
          getCreationDate: returns license key creation date
 long getCreationTimestamp()
          getCreationTimestamp: returns license key creation timestamp expressed as no.
 java.lang.String getCreatorUsername()
          getCreatorUsername: returns license key creator user name
 java.lang.String getEndCustomerCompanyName()
          getEndCustomerCompanyName: returns license key end customer company name
 java.lang.String getId()
          getId: returns a unique identifier that serves as a surrogate for the unique license key (which is very long).
 long getLuConsumption(EzLicenseVendorLuPolicy luPolicy)
          Obtain the license-unit consumption for this license key based on the specified vendor license unit policy.
 java.lang.String getProductName()
          getProductName: returns license key ISV product name
 void parseLicenseKey(java.lang.String licenseKey, java.lang.String username)
          Parse the given license key, setting up the license parameters in the class context.
static EzLicenseFullInfo regenLicenseKey(java.lang.String oldLicenseKey, long balanceQuota, java.lang.String newLicenseKey)
          NOTE: INTERNAL METHOD NOT INTENDED FOR USE BY ISV.
static EzLicenseFullInfo regenLicenseKey(java.lang.String vendorPasswd, java.lang.String oldLicenseKey, long balanceQuota, java.lang.String newLicenseKey)
          NOTE: INTERNAL METHOD NOT INTENDED FOR USE BY ISV.
 void setCreationDate(java.util.Date creationDate)
          setCreationDate: sets license creation date
 void setCreationTimestamp(long creationTimestamp)
          setCreationTimestamp: sets license creation timestamp to no.
 void setCreatorUsername(java.lang.String creatorUsername)
          setCreatorUsername: sets license key creator user name
 void setEndCustomerCompanyName(java.lang.String endCustomerCompanyName)
          setEndCustomerCompanyName: sets license key end-customer company name
 void setProductName(java.lang.String productName)
          setProductName: sets ISV product name
 
Methods inherited from class com.vs.ezlicrun.EzLicenseInfo
checkDebug, checkLicenseKey, checkLicenseKeySecure, checkLongValue, checkMultiUserLicenseKeyBasic, checkSingleUserLicenseKeyBasic, checkTsString, createKeyCookieSeed, getCustomCookie, getCustomKey, getEnforce, getExpirationDate, getLicenseKey, getLicenseModeBitmap, getLicenseModelCode, getLicenseTypeCode, getOptions, getQuotaValue, getUsageValue, getUserHostNetName, getWarningsBitmap, lookupKey, makeDate, makeTsString, setCustomCookie, setCustomKey, setEnforce, setExpirationDate, setLicenseKey, setLicenseModeBitmap, setLicenseModelCode, setLicenseTypeCode, setOptions, setQuotaValue, setUsageValue, setUserHostNetName, setWarningsBitmap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EzLicenseFullInfo

public EzLicenseFullInfo()
Method Detail

getId

public java.lang.String getId()
                       throws com.vs.ezlicrun.EzLicExceptionBase
getId: returns a unique identifier that serves as a surrogate for the unique license key (which is very long). The ID is guaranteed to be globally unique across all EasyLicenser installations and customers as long as generated keys are not purged from the key database, and is immutable over time. The value is derived, and there is no corresponding mutator.
Returns:
license key identifier string

getCreatorUsername

public java.lang.String getCreatorUsername()
getCreatorUsername: returns license key creator user name
Returns:
license key creator user name string

getEndCustomerCompanyName

public java.lang.String getEndCustomerCompanyName()
getEndCustomerCompanyName: returns license key end customer company name
Returns:
license key end-customer company name

getProductName

public java.lang.String getProductName()
getProductName: returns license key ISV product name
Returns:
license key ISV product name

getCreationDate

public java.util.Date getCreationDate()
getCreationDate: returns license key creation date
Returns:
license key creation date

getCreationTimestamp

public long getCreationTimestamp()
getCreationTimestamp: returns license key creation timestamp expressed as no. of milliseconds past beginning-1970.
Returns:
license key creation timestamp

setCreatorUsername

public void setCreatorUsername(java.lang.String creatorUsername)
setCreatorUsername: sets license key creator user name
Parameters:
creatorUsername: - the license key creator user name

setEndCustomerCompanyName

public void setEndCustomerCompanyName(java.lang.String endCustomerCompanyName)
setEndCustomerCompanyName: sets license key end-customer company name
Parameters:
endCustomerCompanyName: - name of end-customer company the license key

setProductName

public void setProductName(java.lang.String productName)
setProductName: sets ISV product name
Parameters:
productName: - name of ISV product

setCreationDate

public void setCreationDate(java.util.Date creationDate)
setCreationDate: sets license creation date
Parameters:
creationDate: - license key creation date

setCreationTimestamp

public void setCreationTimestamp(long creationTimestamp)
setCreationTimestamp: sets license creation timestamp to no. of milliseconds past beginning-1970.
Parameters:
creationTimestamp: - license key creation timestamp

generateKey

public java.lang.String generateKey(java.lang.String userName)
                             throws com.vs.ezlicrun.EzLicExceptionBase
Generate license key based on class context that was set up through its mutators. The operation will succeed provided the balance quota allows it and the ISV is licensed for the eCommerce option.
Parameters:
userName: - ISV user name
Returns:
generated key (also set up in class context)
Throws:
com.vs.ezlicrun.EzLicExceptionBase - if the key context wasn't set up properly, or the key becomes too big.

generateKey

public java.lang.String generateKey(java.lang.String userName,
                                    java.lang.String vendorPasswd,
                                    java.lang.String vendorCookie,
                                    boolean createConfig)
                             throws com.vs.ezlicrun.EzLicExceptionBase
NOTE: THIS METHOD IS INTENDED FOR INTERNAL USE BY THE EASYLICENSER VENDOR CODE. THE ISV SHOULD USE THE generateKeys(userName) METHOD ONLY. Generate license key based on class context that was set up through its mutators. Create the ezconfig if instructed, and update the license key, registration date and / or license key acceptance date if instructed.
Parameters:
userName: - ISV user name
vendorPasswd: - special vendor password for vendor-related key generation.
vendorCookie: - vendor cookie to set for custom cookie.
createConfig: - whether to create and populate an ISV ezconfig, if this is a vendor key generation.
Returns:
generated key (also set up in class context)
Throws:
com.vs.ezlicrun.EzLicExceptionBase - if the key context wasn't set up properly, or the key becomes too big, or the (ISV) user doesn't have the license to generate keys in this mode.

regenLicenseKey

public static EzLicenseFullInfo regenLicenseKey(java.lang.String oldLicenseKey,
                                                long balanceQuota,
                                                java.lang.String newLicenseKey)
                                         throws com.vs.ezlicrun.EzLicExceptionBase
NOTE: INTERNAL METHOD NOT INTENDED FOR USE BY ISV. regenLicenseKey: regenerate an ISV license key based on an existing ISV license key, setting the license info context to the new values and returning the resultant new license key that reflects the updated quota and expiration date. Both keys have to have the same license model and usage policy.
Parameters:
oldLicenseKey: - old license key
balanceQuota: - balance quota
newLicenseKey: - new incremental license key
Returns:
resultant cumulative license info class
Throws:
com.vs.ezlicrun.EzLicExceptionBase -  

regenLicenseKey

public static EzLicenseFullInfo regenLicenseKey(java.lang.String vendorPasswd,
                                                java.lang.String oldLicenseKey,
                                                long balanceQuota,
                                                java.lang.String newLicenseKey)
                                         throws com.vs.ezlicrun.EzLicExceptionBase
NOTE: INTERNAL METHOD NOT INTENDED FOR USE BY ISV. regenLicenseKey: regenerate a vendor license key based on an existing vendor license key, setting the license info context to the new values and returning the resultant new license key that reflects the updated quota and expiration date. Both keys have to have the same license model, usage policy, product and customer, and the new key has to have a creation date following the old key's creation date.
Parameters:
vendorPasswd: - password for vendor key regeneration
oldLicenseKey: - old license key
newLicenseKey: - new incremental license key
Returns:
resultant cumulative license info class
Throws:
com.vs.ezlicrun.EzLicExceptionBase -  

parseLicenseKey

public void parseLicenseKey(java.lang.String licenseKey,
                            java.lang.String username)
                     throws com.vs.ezlicrun.EzLicExceptionBase
Parse the given license key, setting up the license parameters in the class context.
Parameters:
licenseKey: - license key.
username: - the user who is supposed to be the creator.
Throws:
com.vs.ezlicrun.EzLicExceptionBase - if a problem was encountered in the key syntax.

getLuConsumption

public long getLuConsumption(EzLicenseVendorLuPolicy luPolicy)
                      throws com.vs.ezlicrun.EzLicExceptionBase
Obtain the license-unit consumption for this license key based on the specified vendor license unit policy.
Parameters:
luPolicy: - Vendor license unit policy
Returns:
The number of license units consumed for this key
Throws:
com.vs.ezlicrun.EzLicExceptionBase - if this license info is not valid