com.cinnabarsystems.clm
Class LicenseManager

java.lang.Object
  extended by com.cinnabarsystems.clm.LicenseManager

public class LicenseManager
extends Object

Class used to acquire licenses at run time. Clients should construct a single instance of this class per license file, then use that instance to attempt to acquire licenses for each product/feature combination necessary for program operation.


Constructor Summary
LicenseManager(InputStream clmLicenseStream, File licenseDirectory, String licenseFileExtension, InputStream verificationKeyStream)
          Constructs an object for license acquisition.
LicenseManager(InputStream clmLicenseStream, File licenseDirectory, String licenseFileExtension, PublicKey verificationKey)
          Constructs an object for license acquisition.
LicenseManager(InputStream clmLicenseStream, InputStream licenseStream, InputStream verificationKeyStream)
          Constructs an object for license acquisition.
LicenseManager(InputStream clmLicenseStream, InputStream licenseStream, PublicKey verificationKey)
          Constructs an object for license acquisition.
 
Method Summary
 License acquireLicense(String product, String feature)
          Acquire a license for a given product and feature.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseManager

public LicenseManager(InputStream clmLicenseStream,
                      InputStream licenseStream,
                      PublicKey verificationKey)
               throws IOException,
                      LicenseManagerException,
                      GeneralSecurityException
Constructs an object for license acquisition.

Parameters:
clmLicenseStream - stream where the license for CLM itself can be read
licenseStream - stream where the license file can be found
verificationKey - key to use for verifying the license signature
Throws:
LicenseManagerException - Thrown if the CLM license cannot be acquired
IOException
GeneralSecurityException

LicenseManager

public LicenseManager(InputStream clmLicenseStream,
                      InputStream licenseStream,
                      InputStream verificationKeyStream)
               throws IOException,
                      LicenseManagerException,
                      GeneralSecurityException
Constructs an object for license acquisition.

Parameters:
clmLicenseStream - stream where the license for CLM itself can be read
licenseStream - stream where the license file can be found
verificationKeyStream - stream where the public key to use for verifying the license signature can be found
Throws:
LicenseManagerException - Thrown if the CLM license cannot be acquired
IOException
GeneralSecurityException

LicenseManager

public LicenseManager(InputStream clmLicenseStream,
                      File licenseDirectory,
                      String licenseFileExtension,
                      PublicKey verificationKey)
               throws IOException,
                      LicenseManagerException,
                      GeneralSecurityException
Constructs an object for license acquisition.

Parameters:
clmLicenseStream - stream where the license for CLM itself can be read
licenseDirectory - directory containing license files
licenseFileExtension - extension for license files (wildcards not supported)
verificationKey - key to use for verifying the license signature
Throws:
LicenseManagerException - Thrown if the CLM license cannot be acquired
IOException
GeneralSecurityException

LicenseManager

public LicenseManager(InputStream clmLicenseStream,
                      File licenseDirectory,
                      String licenseFileExtension,
                      InputStream verificationKeyStream)
               throws IOException,
                      LicenseManagerException,
                      GeneralSecurityException
Constructs an object for license acquisition.

Parameters:
clmLicenseStream - stream where the license for CLM itself can be read
licenseDirectory - directory containing license files
licenseFileExtension - extension for license files (wildcards not supported)
verificationKeyStream - stream where the public key to use for verifying the license signature can be found
Throws:
LicenseManagerException - Thrown if the CLM license cannot be acquired
IOException
GeneralSecurityException
Method Detail

acquireLicense

public License acquireLicense(String product,
                              String feature)
                       throws LicenseManagerException
Acquire a license for a given product and feature. If the method returns without throwing any exception, a license was succesfully acquired.

Parameters:
product - product for which to acquire license
feature - feature for which to acquire license
Returns:
a License object describing the license parameters
Throws:
LicenseManagerException