WEBsina Software

com.websina.license
Class LicenseManager

java.lang.Object
  extended bycom.websina.license.LicenseManager
Direct Known Subclasses:
LicenseManagerImpl

public abstract class LicenseManager
extends java.lang.Object

The class is shipped along with the product to the consumer. It is an abstract class and the getInstance() method returns a LicenseManager implemented by LicenseManagerImpl.

Since:
1.0

Constructor Summary
LicenseManager()
           
 
Method Summary
abstract  int daysLeft()
          It returns how many days are left for the license.
abstract  java.lang.String getFeature(java.lang.String name)
          This method is called by the license client to get the feature of the license.
static LicenseManager getInstance()
           
abstract  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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseManager

public LicenseManager()
Method Detail

getInstance

public static final LicenseManager getInstance()

isValid

public abstract 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.

Returns:
whether or not the license is valid.
Throws:
java.security.GeneralSecurityException

daysLeft

public abstract int daysLeft()
It returns how many days are left for the license. Here, 0 should be valid, it may indicate the license never expires.

Returns:
how many days are left for the license.

getFeature

public abstract 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. In fact, by just checking whether or not a feature exist one case validate the proper use of the license.

Returns:
the feature value of the license.

WEBsina Software