All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.java.truelicense.core.LicenseConsumerManager Maven / Gradle / Ivy

Go to download

The TrueLicense Core module provides essential functionality for license management.

There is a newer version: 2.6.6
Show newest version
/*
 * Copyright (C) 2005-2013 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */
package net.java.truelicense.core;

import net.java.truelicense.core.io.Source;
import net.java.truelicense.core.util.ContextProvider;

/**
 * Defines the life cycle management operations for license keys in consumer
 * applications.
 *
 * 

How to Preview License Keys?

*

* Unfortunately, this interface lacks a method to preview the license bean * which is encoded in a given license key. * However, you can do this by using a * {@linkplain LicenseConsumerContext license consumer context} * to configure a license consumer manager which uses a transient * {@link net.java.truelicense.core.io.MemoryStore} instead of a persistent * store - see {@link LicenseConsumerContext.ManagerBuilder#storeIn}. * Once configured, you can {@link #install} the license key to the transient * memory store and {@link #view} its encoded license bean. * * @author Christian Schlichtherle */ public interface LicenseConsumerManager extends ContextProvider, LicenseSubjectProvider, LicenseParametersProvider { /** * Installs the license key from the given source and returns a * {@linkplain LicenseValidation#validate validated} duplicate of its * encoded license bean. *

* Performing this operation requires prior * {@linkplain LicenseAuthorization#clearInstall authorization}. * * @param source the source for loading the license key. * @return A {@linkplain LicenseValidation#validate validated} duplicate of * the license bean which is encoded in the license key. * @throws LicenseValidationException if validating the license bean fails, * e.g. if the license has expired. */ License install(Source source) throws LicenseManagementException; /** * Returns an unvalidated duplicate of the license bean which is encoded in * the installed license key. * Unlike {@link #verify}, this operation skips the validation of the * license bean. * This enables the caller to obtain a duplicate of the license bean even * if validation would fail, e.g. if the license has expired. *

* Performing this operation requires prior * {@linkplain LicenseAuthorization#clearView authorization}. * * @return An unvalidated duplicate of the license bean which is encoded in * the installed license key. */ License view() throws LicenseManagementException; /** * Verifies the license bean which is encoded in the installed license key. * You should call this method whenever you want to "unlock" access to a * feature of your product. * Execution needs to be fast in order to support frequent calling. *

* Performing this operation requires prior * {@linkplain LicenseAuthorization#clearVerify authorization}. * * @throws LicenseValidationException if validating the license bean fails, * e.g. if the license has expired. */ void verify() throws LicenseManagementException; /** * Uninstalls the installed license key. *

* Performing this operation requires prior * {@linkplain LicenseAuthorization#clearUninstall authorization}. */ void uninstall() throws LicenseManagementException; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy