WEBsina Software

com.websina.license
Class License

java.lang.Object
  extended bycom.websina.license.License

public class License
extends java.lang.Object

The class read and write to the license file. it should be used by both the SignManager and the LicenseManager so that they are signing and verifying the same data.

Since:
1.0

Field Summary
static java.lang.String NEVER
           
 
Method Summary
 void create()
          This is called by LicenseTool to create the license.
 java.lang.String format()
          The license data that is used to to create the license file and well as used for validate the license along with the signature.
 java.lang.String getExpiration()
          This method is called by the license client (or the LicenseManager) to validate the license.
 java.lang.String getFeature(java.lang.String name)
          This method is called by the license client (or the LicenseManager) to validate the license.
 java.lang.String getSignature()
          This method is called by the license client (or the LicenseManager) to validate the license.
static License loadLicense()
          The method is used by the LicenseManager to load an existing License.
static License newLicense()
          This method is used by the LicenseTool to create a License.
 void setExpiration(java.lang.String date)
          This method is called by the LicenseTool before creating the license.
 void setFeature(java.lang.String name, java.lang.String value)
          This method is called by the LicenseTool to set the features for the license.
 void setSignature(java.lang.String signature)
          This method is called by the LicenseTool before creating the license.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEVER

public static final java.lang.String NEVER
See Also:
Constant Field Values
Method Detail

newLicense

public static License newLicense()
This method is used by the LicenseTool to create a License. LicenseTool uses the set methods to set the features and then use create() to create the license.

Returns:
a new empty license to be created.

loadLicense

public static License loadLicense()
                           throws LicenseNotFoundException
The method is used by the LicenseManager to load an existing License. LicenseManager uses the get method to validate the license.

Returns:
an existing license to be validated.
Throws:
LicenseNotFoundException

create

public void create()
            throws java.lang.Exception
This is called by LicenseTool to create the license. Before create, data must have been formated so that data and signature exist.

Throws:
java.lang.Exception

format

public java.lang.String format()
The license data that is used to to create the license file and well as used for validate the license along with the signature.

Returns:
the license data that is used to to create the license file and well as used for validate the license along with the signature.

getFeature

public java.lang.String getFeature(java.lang.String name)
This method is called by the license client (or the LicenseManager) to validate the license.

Parameters:
name - a feature in the license.
Returns:
the value corresponding to this feature.

setFeature

public void setFeature(java.lang.String name,
                       java.lang.String value)
This method is called by the LicenseTool to set the features for the license.

Parameters:
name - a feature of the license.
value - the value of the feature.

getExpiration

public java.lang.String getExpiration()
This method is called by the license client (or the LicenseManager) to validate the license.

Returns:
the expiration date.

setExpiration

public void setExpiration(java.lang.String date)
This method is called by the LicenseTool before creating the license.

Parameters:
date - the license expiration date.

getSignature

public java.lang.String getSignature()
This method is called by the license client (or the LicenseManager) to validate the license.

Returns:
the signature of the license.

setSignature

public void setSignature(java.lang.String signature)
This method is called by the LicenseTool before creating the license.

Parameters:
signature - the license signature.

WEBsina Software