chemaxon.license
Class LicenseManager

java.lang.Object
  extended bychemaxon.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 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 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 IQSAR
          Identifier of product: IQSAR
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 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 METABOLIZER
          Identifier of product: Metabolizer
static java.lang.String PARTITIONING_PLUGIN_GROUP
          Identifier of plugin: Partitioning Plugin Group
static java.lang.String PROTONATION_PLUGIN_GROUP
          Identifier of plugin: Protonation Plugin Group
static java.lang.String QSAR
          Identifier of product: 3D QSAR
static java.lang.String REACTOR
          Identifier of product: Reactor
static java.lang.String REFRACTIVITY_PLUGIN
          Identifier of plugin: Refractivity Plugin
static java.lang.String SCREEN
          Identifier of product: Screen
static java.lang.String SOLUBILITY_PLUGIN
          Identifier of plugin: Solubility Plugin
static java.lang.String STANDARDIZER
          Identifier of product: Standardizer
 
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 getPluginList()
          Returns the list of the plugin identifiers known by the license manager.
static java.util.ArrayList 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

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

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

IQSAR

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

See Also:
Constant Field Values

QSAR

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

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

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

SOLUBILITY_PLUGIN

public static final java.lang.String SOLUBILITY_PLUGIN
Identifier of plugin: Solubility 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
Constructor Detail

LicenseManager

public LicenseManager()
Method Detail

getProductList

public static java.util.ArrayList 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 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 java.io.IOException
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:
java.io.IOException - when a problem occurs reading or validating licenses

setLicense

public static void setLicense(java.lang.String s)
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

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