com.cafesoft.core.license
Class AbstractProductLicenseManager

java.lang.Object
  |
  +--com.cafesoft.core.license.AbstractProductLicenseManager
All Implemented Interfaces:
ProductLicenseManager

public abstract class AbstractProductLicenseManager
extends Object
implements ProductLicenseManager

AbstractProductLicenseManager implements the more mundane methods of a ProductLicenseManager, which manages and validates ProductLicense instances.

Since:
9/30/2002

Constructor Summary
AbstractProductLicenseManager()
           
 
Method Summary
 void addProductLicense(ProductLicense productLicense)
          Add a ProductLicense.
abstract  void assertValid()
          Assert that all ProductLicenses are valid.
 ProductLicense getProductLicense(String name)
          Get a ProductLicense by name.
 ProductLicense[] getProductLicenses()
          Get all ProductLicenses.
abstract  void initialize(Object config)
          Initialize the ProductLicenseManager.
 boolean isLocked()
          Check the ProductLicenseManager locked status
 void lock()
          Lock the ProductLicenseManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProductLicenseManager

public AbstractProductLicenseManager()
Method Detail

initialize

public abstract void initialize(Object config)
                         throws ProductLicenseException
Initialize the ProductLicenseManager.

Specified by:
initialize in interface ProductLicenseManager
Parameters:
config - an implementation-specific configuration parameter. This may be a Properties object, a File, or any other object specific to the ProductLicenseManager implementation.
Throws:
ProductLicenseException - if an error initializing the ProductLicenseManager.

addProductLicense

public final void addProductLicense(ProductLicense productLicense)
                             throws ProductLicenseException
Add a ProductLicense.

Specified by:
addProductLicense in interface ProductLicenseManager
Parameters:
productLicense - the product license.
Throws:
ProductLicenseException - if an invalid or unknown product license is added, or if the ProductLicenseManager is locked and cannot be modified.

getProductLicenses

public final ProductLicense[] getProductLicenses()
Get all ProductLicenses.

Specified by:
getProductLicenses in interface ProductLicenseManager
Returns:
an array of ProductLicense instances in the order they were added.

getProductLicense

public final ProductLicense getProductLicense(String name)
Get a ProductLicense by name.

Specified by:
getProductLicense in interface ProductLicenseManager
Parameters:
name - the name of the ProductLicense.
Returns:
the ProductLicense with the specified name or null if no ProductLicense by that name has been added.

lock

public final void lock()
Lock the ProductLicenseManager. Once locked, the ProductLicenseManager and the ProductLicenses it contains cannot be modified and attempting to do so will throw a ProductLicenseException.

Specified by:
lock in interface ProductLicenseManager

isLocked

public boolean isLocked()
Check the ProductLicenseManager locked status

Specified by:
isLocked in interface ProductLicenseManager
Returns:
true if the ProductLicenseManager is locked, else false.

assertValid

public abstract void assertValid()
                          throws ProductLicenseException
Assert that all ProductLicenses are valid.

Specified by:
assertValid in interface ProductLicenseManager
Throws:
ProductLicenseException - if a ProductLicense is not valid, the ProductLicenseManager or a ProductLicense is NOT locked at validation time.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.