Licensing Model

Cmobilecom AF license is a commercial license for OEMs, ISVs, VARs and others who develop applications using Cmobilecom AF for either commercial or internal uses.
OEMs: Original Equipment Manufacturers
ISVs: Independent Software Vendors
VARs: Value Added Resellers
Application license is to license modules and features on the top of Cmobilecom AF license. Cmobilecom AF license is required for application license to take effect. Copy Cmobilecom AF license to
	[cmobilecom.home]/license/system/af.license
and restart server.

Issue Licenses

Create an account on Cmobilecom.com and create a License Issuer instance on Cmobilecom cloud. There are two models to issue application licenses:

License API

A License can contain one ore more feature groups. A license feature group is mapped to an instance type defined in system-conf.xml. System InstanceType has exactly one instance, but a subsystem InstanceType can have many instances.

For each licensed InstanceType, the license controls instances, users and features. A feature can be a whole module or a functionality in a module. For each feature within the InstanceType to be licensed, the license controls its type(evaluation or commercial), start date and expire date. Expiration date is optional.

Module has two license related methods:


	public ModuleScopedName getLicenseFeatureRequired();
	public String getLicenseIssuerDomain();
The feature controls the access of the whole module. A module can also define as many features as needed to be controled by license. The license issuer domain is defined in your License Issuer instance on Cmobilecom cloud. A license issued by an unauthorized issuer will be rejected.

Get current installed application license:


	BackingBeanContext context = BackingBeanContext.getInstance();
	License license = context.getInstalledLicense();
Using License API, we can check if a feature is licensed within an InstanceType. Also BackingBeanContext provides some convenient methods for checking license status and verify license.

	public License.Status getLicenseStatus(String module, String featureName)
	public License.Status getLicenseStatus(String instanceTypeId, String module, String featureName, Date date)
	public boolean isFeatureLicensed(String module, String featureName)
	public boolean isFeatureLicensed(String instanceTypeId, String module, String featureName, Date date)
	public License verifyLicense(String module, String featureName)
See Cmobilecom AF javadoc and License Client API javadoc for detail.

Quantity Control

A License can have a quantity that controls how many installations can use the license. Quantity control is effective only for Model One by giving users license credential instead of license itself.

User Control

A license can set user count limits for an InstanceType: how many users can be created in an instance of the InstanceType, and how many users can login into an instance of the InstanceType concurrently.

Local Cache

When creating licenses for a software, local cache timeout of the licenses can be specified. For example, 30 days. The licenses will be cached in user's local machine until it expires. When it expires, a GET license request will be automatically sent to License Server if license credential is found.

If cache timeout is not specified, the license local cache will never expire.

Floating

If a license is fetched using credential, it can be released to License Server, and another instance can get the license.

Limits of Evaluation License

A feature can be licensed as Evaluation or Commercial. If a module is licensed as evaluation, its entity quantity quota can be set. For example, ExampleHR module, set the maximum number of Expense Claims to be 20 for evaluation license by overriding getQuotaListForEvaluateLicense() method of Module interface.

	public class HrModule extends AbstractModule {
		@Override
		public List<Quota> getQuotaListForEvaluateLicense() {
			List<Quota> quotaList = new ArrayList<Quota>();
			
			Quota quota = new Quota(ExpenseClaim.class, 100);
			quotaList.add(quota);
			
			return quotaList;
		}
	}
A feature can be disabled for evaluation license. For example,

	BackingBeanContext context = BackingBeanContext.getInstance();
	License.Status status = context.getLicenseStatus(featureName);
	if (status.equals(License.Status.VALID)) {
		License license = context.getInstalledLicense(null);
		if (!license.isEvaluate(instanceTypeId, featureName)) {
		   // features available for commercial license only
		}
	}
A valid license feature type can be evaluation or commercial.