net.java.truelicense.core.LicenseConsumerManager Maven / Gradle / Ivy
Show all versions of truelicense-core Show documentation
/*
* 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;
/**
* Defines the life cycle management operations for license keys in consumer
* applications.
*
* Applications have no need to implement this interface and should not do so
* because it may be subject to expansion in future versions.
*
* @author Christian Schlichtherle
*/
public interface LicenseConsumerManager
extends LicenseSubjectProvider, LicenseParametersProvider {
/**
* Returns the consumer context from which this consumer manager originated.
*/
LicenseConsumerContext context();
/**
* Installs the license key from the given source.
* Performing this operation requires prior
* {@linkplain LicenseAuthorization#clearInstall authorization}.
*
* @param source the source for loading the license key.
* @return A duplicate of the
* {@linkplain LicenseValidation#validate validated} license in the
* installed license key.
*/
License install(Source source) throws LicenseManagementException;
/**
* Returns a duplicate of the (unvalidated) license in the installed
* license key.
* Unless {@link #verify}, this operation skips the validation of the
* license.
* This enables the caller to obtain a duplicate of the installed license
* even if validation would fail, e.g. if the license has been expired.
*
* Performing this operation requires prior
* {@linkplain LicenseAuthorization#clearView authorization}.
*
* @return A duplicate of the (unvalidated) license in the installed
* license key.
*/
License view() throws LicenseManagementException;
/**
* Verifies the license in the installed license key.
* Performing this operation requires prior
* {@linkplain LicenseAuthorization#clearVerify authorization}.
*/
void verify() throws LicenseManagementException;
/**
* Uninstalls the installed license key.
* Performing this operation requires prior
* {@linkplain LicenseAuthorization#clearUninstall authorization}.
*/
void uninstall() throws LicenseManagementException;
}