WEBsina Software

com.websina.license
Class LicenseManagerImpl

java.lang.Object
  extended bycom.websina.license.LicenseManager
      extended bycom.websina.license.LicenseManagerImpl

public class LicenseManagerImpl
extends LicenseManager

This class is shipped along with the product to the consumer. It is used to verify the license. The license is a text file also shipped to the comsumer.

Since:
1.0

Constructor Summary
protected LicenseManagerImpl()
           
 
Method Summary
 int daysLeft()
          It returns how many days are left for the license.
 java.lang.String getFeature(java.lang.String name)
          This method is called by the license client to get the feature of the license.
 boolean isValid()
          It first checks the license itself is not tampered and is valid, and then checks the license is not expired.
 
Methods inherited from class com.websina.license.LicenseManager
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseManagerImpl

protected LicenseManagerImpl()
Method Detail

isValid

public boolean isValid()
                throws java.security.GeneralSecurityException
It first checks the license itself is not tampered and is valid, and then checks the license is not expired. User should use getFeature(feature) for additional validation.

Specified by:
isValid in class LicenseManager
Returns:
whether or not the license is valid.
Throws:
java.security.GeneralSecurityException

daysLeft

public int daysLeft()
It returns how many days are left for the license. Here, 0 is valid, it may indicate a never expire license.

Specified by:
daysLeft in class LicenseManager
Returns:
how many days are left for the license.

getFeature

public java.lang.String getFeature(java.lang.String name)
This method is called by the license client to get the feature of the license. For example, user may use IP_Address as a feature, and encode a particular IP address inside the license. This IP is then checked against the machine when the user's software is running. One should first call isValid() before calling this method.

Specified by:
getFeature in class LicenseManager
Returns:
the feature value of the license.

WEBsina Software