org.rhq.enterprise.server.license
Class LicenseManager

java.lang.Object
  extended by org.rhq.enterprise.server.license.LicenseManager
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public final class LicenseManager
extends java.lang.Object
implements java.lang.Runnable, java.io.Serializable

See Also:
Serialized Form

Field Summary
static int FEATURE_MONITOR
           
protected  javax.naming.InitialContext ic
           
protected  java.lang.String JNDI_NAME
           
 
Method Summary
static void checkLicense(java.io.InputStream licenseFile)
          Tests a license file by running it through the parser.
protected static void doHalt(java.lang.String msg)
           
protected static void doHalt(java.lang.String msg, java.lang.Exception e)
           
 void doStartupCheck(java.lang.String licenseFile)
          Called by ProductPluginDeployer at startup to enforce the following license provisions: : ensure that the customer's license has not expired : ensure that at least one of the server's IPs matches one of the licensed IPs.
 void enforceFeatureLimit(int feature)
           
static void enforceFeatureLimit(License license, int feature)
           
 void enforcePlatformLimit(int count)
           
 long getExpiration()
           
 License getLicense()
           
static java.lang.String getLicenseFileName()
           
 java.lang.String getLicenseInfoString()
           
static LicenseManager instance()
           
 boolean isLicenseExpired()
           
 boolean isLicenseLoaded()
           
 boolean isPluginEnabled(java.lang.String name)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_MONITOR

public static final int FEATURE_MONITOR
See Also:
Constant Field Values

ic

protected transient javax.naming.InitialContext ic

JNDI_NAME

protected java.lang.String JNDI_NAME
Method Detail

instance

public static LicenseManager instance()

checkLicense

public static void checkLicense(java.io.InputStream licenseFile)
                         throws LicenseParsingException,
                                UnavailableLicenseException,
                                CorruptLicenseException,
                                UpdateTrialLicenseException
Tests a license file by running it through the parser. Throws an exception if something fails to parse. Proper exceptions should really be integrated at some point.

Throws:
LicenseParsingException
UnavailableLicenseException
CorruptLicenseException
UpdateTrialLicenseException

doHalt

protected static final void doHalt(java.lang.String msg,
                                   java.lang.Exception e)

doHalt

protected static final void doHalt(java.lang.String msg)

doStartupCheck

public final void doStartupCheck(java.lang.String licenseFile)
Called by ProductPluginDeployer at startup to enforce the following license provisions: : ensure that the customer's license has not expired : ensure that at least one of the server's IPs matches one of the licensed IPs.


isLicenseExpired

public boolean isLicenseExpired()

isLicenseLoaded

public boolean isLicenseLoaded()

run

public void run()
Specified by:
run in interface java.lang.Runnable

isPluginEnabled

public boolean isPluginEnabled(java.lang.String name)

enforcePlatformLimit

public void enforcePlatformLimit(int count)
                          throws PlatformLimitException
Throws:
PlatformLimitException

enforceFeatureLimit

public void enforceFeatureLimit(int feature)
                         throws FeatureUnavailableException
Throws:
FeatureUnavailableException

enforceFeatureLimit

public static void enforceFeatureLimit(License license,
                                       int feature)
                                throws FeatureUnavailableException
Throws:
FeatureUnavailableException

getLicense

public License getLicense()

getLicenseFileName

public static java.lang.String getLicenseFileName()

getExpiration

public long getExpiration()
                   throws LicenseException
Returns:
The expiration time in millis, or -1 if there is no expiration.
Throws:
LicenseException

getLicenseInfoString

public java.lang.String getLicenseInfoString()


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.