chemaxon.license
Class LicenseManager

java.lang.Object
  extended by chemaxon.license.LicenseManager

public class LicenseManager
extends java.lang.Object

LicenseManager is a helper class to manage licenses of ChemAxon products. The licenses are stored in xml files (license.cxl) and are digitally signatured by ChemAxon. The default location of the license file is USER_HOME/chemaxon/license.cxl, but this can arbitrarily be changed. The old license files (licenses.dat) are supported till September 2008.

Since:
Marvin 5.0.1
Version:
5.0 Jan 28, 2008
Author:
Judit Vasko-Szedlar

Field Summary
static java.lang.String ALIGNMENT
          Identifier of product: Alignment
static java.lang.String CALCULATIONS_PACK
          Identifier of product: Calculations Pack
static java.lang.String CARTRIDGE
          Identifier of product: JChem Cartridge
static java.lang.String CHARGE_PLUGIN_GROUP
          Identifier of plugin: Charge Plugin Group
static java.lang.String CONFORMATION_PLUGIN_GROUP
          Identifier of plugin: Conformation Plugin Group
static java.lang.String DOCUMENT_TO_STRUCTURE
          Identifier of product: Document to Structure
static java.lang.String ECFP_FCFP
          Identifier of product: Molecular Descriptors
static java.lang.String FRAGMENTER
          Identifier of product: Fragmenter
static java.lang.String GEOMETRY_PLUGIN_GROUP
          Identifier of plugin: Geometry Plugin Group
static java.lang.String HBDA_PLUGIN
          Identifier of plugin: HBDA Plugin
static java.lang.String HUCKEL_ANALYSIS_PLUGIN
          Identifier of plugin: Huckel Analysis Plugin
static java.lang.String INSTANT_JCHEM
          Identifier of product: Instant JChem
static java.lang.String INSTANT_JCHEM_VIZ
          Identifier of product: Instant JChem VIZ
static java.lang.String ISOMERS_PLUGIN_GROUP
          Identifier of plugin: Isomers Plugin Group
static java.lang.String IUPAC_NAMING_PLUGIN
          Identifier of plugin: IUPAC Naming Plugin
static java.lang.String JCHEM
          Identifier of product: JChem Base
static java.lang.String JCHEM_FOR_EXCEL
          Identifier of product: JChem for Excel
static java.lang.String JKLUSTOR
          Identifier of product: JKlustor
static java.lang.String MARKUSH_ENUM_PLUGIN
          Identifier of plugin: Markush Enumeration Plugin
static java.lang.String MARKUSH_SEARCH
          Identifier of product: Markush Search
static java.lang.String MARVIN_APPLETS
          Identifier of product: Marvin Applets
static java.lang.String MARVIN_BEANS
          Identifier of product: Marvin Beans
static java.lang.String MCES
          Identifier of product: MCES
static java.lang.String METABOLIZER
          Identifier of product: Metabolizer
static java.lang.String MOLECULAR_DESCRIPTORS
          Identifier of product: Molecular Descriptors
static java.lang.String NAME_TO_STRUCTURE
          Identifier of product: Name to Structure
static java.lang.String PARTITIONING_PLUGIN_GROUP
          Identifier of plugin: Partitioning Plugin Group
static java.lang.String PREDICTOR_PLUGIN
          Identifier of product: Predictor Plugin
static java.lang.String PROTONATION_PLUGIN_GROUP
          Identifier of plugin: Protonation Plugin Group
static java.lang.String REACTOR
          Identifier of product: Reactor
static java.lang.String REFRACTIVITY_PLUGIN
          Identifier of plugin: Refractivity Plugin
static java.lang.String REGISTRATION_SYSTEM
          Identifier of product: Structure Checker
static java.lang.String SCREEN
          Identifier of product: Screen
static java.lang.String SCREEN3D
          Identifier of product: 3D Screen
static java.lang.String SHAREPOINT
          Identifier of product: SharePoint
static java.lang.String STANDARDIZER
          Identifier of product: Standardizer
static java.lang.String STRUCTURAL_FRAMEWORKS_PLUGIN
          Identifier of product: Structural Frameworks Plugin
static java.lang.String STRUCTURE_CHECKER
          Identifier of product: Structure Checker
static java.lang.String STRUCTURE_TO_NAME
          Identifier of product: Structure to Name
static java.lang.String WEB_SERVICES_SERVER
          Identifier of product: Web Services Server
 
Constructor Summary
LicenseManager()
           
 
Method Summary
static javax.swing.JPanel createLicenseManagerPanel()
          Creates the main panel which is used for end-user license managing.
static java.lang.String getLicenseExceptionMessage()
          Returns the common message used at license problems.
static javax.swing.JPanel getLicenseExceptionPanel(chemaxon.license.LicenseException exc)
          Returns the common swing component used to indicate missing license.
static javax.swing.JPanel getLicenseExceptionPanel(java.lang.String product)
          Returns the common swing component used to indicate missing license.
static java.util.ArrayList<java.lang.String> getPluginList()
          Returns the list of the plugin identifiers known by the license manager.
static java.util.ArrayList<java.lang.String> getProductList(boolean includePlugins)
          Returns the list of the product identifiers known by the license manager.
static boolean isLicensed(java.lang.String product)
          Returns true if the license manager recognizes the given product to be licensed.
static void refresh()
          Re-reads licenses from the default locations.
static void setLicense(java.lang.String s)
          Sets a pre-read license file to the license manager to read and validate licenses from.
static void setLicenseFile(java.lang.String licensePath)
          Sets the license file location to the license manager to read and validate licenses from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARVIN_APPLETS

public static final java.lang.String MARVIN_APPLETS
Identifier of product: Marvin Applets

See Also:
Constant Field Values

MARVIN_BEANS

public static final java.lang.String MARVIN_BEANS
Identifier of product: Marvin Beans

See Also:
Constant Field Values

INSTANT_JCHEM

public static final java.lang.String INSTANT_JCHEM
Identifier of product: Instant JChem

See Also:
Constant Field Values

INSTANT_JCHEM_VIZ

public static final java.lang.String INSTANT_JCHEM_VIZ
Identifier of product: Instant JChem VIZ

See Also:
Constant Field Values

JCHEM

public static final java.lang.String JCHEM
Identifier of product: JChem Base

See Also:
Constant Field Values

CARTRIDGE

public static final java.lang.String CARTRIDGE
Identifier of product: JChem Cartridge

See Also:
Constant Field Values

STANDARDIZER

public static final java.lang.String STANDARDIZER
Identifier of product: Standardizer

See Also:
Constant Field Values

SCREEN

public static final java.lang.String SCREEN
Identifier of product: Screen

See Also:
Constant Field Values

MCES

public static final java.lang.String MCES
Identifier of product: MCES

See Also:
Constant Field Values

SCREEN3D

public static final java.lang.String SCREEN3D
Identifier of product: 3D Screen

See Also:
Constant Field Values

ALIGNMENT

public static final java.lang.String ALIGNMENT
Identifier of product: Alignment

See Also:
Constant Field Values

MOLECULAR_DESCRIPTORS

public static final java.lang.String MOLECULAR_DESCRIPTORS
Identifier of product: Molecular Descriptors

See Also:
Constant Field Values

ECFP_FCFP

public static final java.lang.String ECFP_FCFP
Identifier of product: Molecular Descriptors

See Also:
Constant Field Values

REACTOR

public static final java.lang.String REACTOR
Identifier of product: Reactor

See Also:
Constant Field Values

FRAGMENTER

public static final java.lang.String FRAGMENTER
Identifier of product: Fragmenter

See Also:
Constant Field Values

JKLUSTOR

public static final java.lang.String JKLUSTOR
Identifier of product: JKlustor

See Also:
Constant Field Values

METABOLIZER

public static final java.lang.String METABOLIZER
Identifier of product: Metabolizer

See Also:
Constant Field Values

MARKUSH_SEARCH

public static final java.lang.String MARKUSH_SEARCH
Identifier of product: Markush Search

See Also:
Constant Field Values

NAME_TO_STRUCTURE

public static final java.lang.String NAME_TO_STRUCTURE
Identifier of product: Name to Structure

See Also:
Constant Field Values

DOCUMENT_TO_STRUCTURE

public static final java.lang.String DOCUMENT_TO_STRUCTURE
Identifier of product: Document to Structure

See Also:
Constant Field Values

STRUCTURE_TO_NAME

public static final java.lang.String STRUCTURE_TO_NAME
Identifier of product: Structure to Name

See Also:
Constant Field Values

JCHEM_FOR_EXCEL

public static final java.lang.String JCHEM_FOR_EXCEL
Identifier of product: JChem for Excel

See Also:
Constant Field Values

CALCULATIONS_PACK

public static final java.lang.String CALCULATIONS_PACK
Identifier of product: Calculations Pack

See Also:
Constant Field Values

WEB_SERVICES_SERVER

public static final java.lang.String WEB_SERVICES_SERVER
Identifier of product: Web Services Server

See Also:
Constant Field Values

SHAREPOINT

public static final java.lang.String SHAREPOINT
Identifier of product: SharePoint

See Also:
Constant Field Values

STRUCTURE_CHECKER

public static final java.lang.String STRUCTURE_CHECKER
Identifier of product: Structure Checker

See Also:
Constant Field Values

REGISTRATION_SYSTEM

public static final java.lang.String REGISTRATION_SYSTEM
Identifier of product: Structure Checker

See Also:
Constant Field Values

PROTONATION_PLUGIN_GROUP

public static final java.lang.String PROTONATION_PLUGIN_GROUP
Identifier of plugin: Protonation Plugin Group

See Also:
Constant Field Values

PARTITIONING_PLUGIN_GROUP

public static final java.lang.String PARTITIONING_PLUGIN_GROUP
Identifier of plugin: Partitioning Plugin Group

See Also:
Constant Field Values

CHARGE_PLUGIN_GROUP

public static final java.lang.String CHARGE_PLUGIN_GROUP
Identifier of plugin: Charge Plugin Group

See Also:
Constant Field Values

ISOMERS_PLUGIN_GROUP

public static final java.lang.String ISOMERS_PLUGIN_GROUP
Identifier of plugin: Isomers Plugin Group

See Also:
Constant Field Values

CONFORMATION_PLUGIN_GROUP

public static final java.lang.String CONFORMATION_PLUGIN_GROUP
Identifier of plugin: Conformation Plugin Group

See Also:
Constant Field Values

GEOMETRY_PLUGIN_GROUP

public static final java.lang.String GEOMETRY_PLUGIN_GROUP
Identifier of plugin: Geometry Plugin Group

See Also:
Constant Field Values

HUCKEL_ANALYSIS_PLUGIN

public static final java.lang.String HUCKEL_ANALYSIS_PLUGIN
Identifier of plugin: Huckel Analysis Plugin

See Also:
Constant Field Values

REFRACTIVITY_PLUGIN

public static final java.lang.String REFRACTIVITY_PLUGIN
Identifier of plugin: Refractivity Plugin

See Also:
Constant Field Values

HBDA_PLUGIN

public static final java.lang.String HBDA_PLUGIN
Identifier of plugin: HBDA Plugin

See Also:
Constant Field Values

MARKUSH_ENUM_PLUGIN

public static final java.lang.String MARKUSH_ENUM_PLUGIN
Identifier of plugin: Markush Enumeration Plugin

See Also:
Constant Field Values

IUPAC_NAMING_PLUGIN

public static final java.lang.String IUPAC_NAMING_PLUGIN
Identifier of plugin: IUPAC Naming Plugin

See Also:
Constant Field Values

STRUCTURAL_FRAMEWORKS_PLUGIN

public static final java.lang.String STRUCTURAL_FRAMEWORKS_PLUGIN
Identifier of product: Structural Frameworks Plugin

See Also:
Constant Field Values

PREDICTOR_PLUGIN

public static final java.lang.String PREDICTOR_PLUGIN
Identifier of product: Predictor Plugin

See Also:
Constant Field Values
Constructor Detail

LicenseManager

public LicenseManager()
Method Detail

getProductList

public static java.util.ArrayList<java.lang.String> getProductList(boolean includePlugins)
Returns the list of the product identifiers known by the license manager.

Parameters:
includePlugins - whether the list should contain the name of the plugins as well
Returns:
list containing names as identifiers

getPluginList

public static java.util.ArrayList<java.lang.String> getPluginList()
Returns the list of the plugin identifiers known by the license manager.

Returns:
list containing names as identifiers

getLicenseExceptionMessage

public static java.lang.String getLicenseExceptionMessage()
Returns the common message used at license problems.

Returns:
error message string

getLicenseExceptionPanel

public static javax.swing.JPanel getLicenseExceptionPanel(java.lang.String product)
Returns the common swing component used to indicate missing license.

Parameters:
product - identifier of a product
Returns:
JPanel with detailed information about the missing license

getLicenseExceptionPanel

public static javax.swing.JPanel getLicenseExceptionPanel(chemaxon.license.LicenseException exc)
Returns the common swing component used to indicate missing license.

Parameters:
exc - a LicenseException thrown at license checking
Returns:
JPanel with detailed information about the missing license

createLicenseManagerPanel

public static javax.swing.JPanel createLicenseManagerPanel()
Creates the main panel which is used for end-user license managing.

Returns:
JPanel

setLicenseFile

public static void setLicenseFile(java.lang.String licensePath)
                           throws chemaxon.license.LicenseProcessingException
Sets the license file location to the license manager to read and validate licenses from. This additive setting will not clear already read licenses. The old license file, licenses.dat is not allowed to set for security reasons.

Parameters:
licensePath - path of the license file that can be absolute file location or URL
Throws:
chemaxon.license.LicenseProcessingException - when a problem occurs reading or validating licenses

setLicense

public static void setLicense(java.lang.String s)
                       throws chemaxon.license.LicenseProcessingException
Sets a pre-read license file to the license manager to read and validate licenses from. This additive setting will not clear already read licenses. Non-server mode licenses and the old license keys are not allowed to set with this method for security reasons.

Parameters:
s - license file content as String
Throws:
chemaxon.license.LicenseProcessingException - when a problem occurs reading or validating licenses

refresh

public static void refresh()
Re-reads licenses from the default locations.


isLicensed

public static boolean isLicensed(java.lang.String product)
Returns true if the license manager recognizes the given product to be licensed.

Parameters:
product - identifier of a product
Returns:
informative state value