|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.util.license.LicenseManager
public final class LicenseManager
LicenseManager provides the ability to use limited licenses based on classes and package names. Note that the LicenseManager only accepts Licenses that are properly signed, i.e. they will have to be created by an authorized issuer.
Once the LicenseManager is initialized, a set of licenses is installed from the licenses.dat file in the resource directory from the distribution; if any licenses therein are invalid or the file is non-existent, the resulting errors are ignored and the LicenseManager contains no licenses to begin with. Generally, an application can go without using the LicenseManager explicitly. The classorg.jscience.util.Settings provides a few convenience
methods that may suffice for a standard application.
Settings,
License,
Licensed,
LicenseHandler,
LicensingException,
Settings.checkLicense(Object),
Settings.installLicenses(java.io.InputStream),
org.jscience.util.Settings#installLicense(org.jscience.License)| Method Summary | |
|---|---|
void |
check(java.lang.Object licensee)
checks for a valid license for the given object and only returns gracefully if a valid license was found. |
License |
getLicense(java.lang.Object licensee)
returns the license in use for the given licensee |
static LicenseManager |
getLicenseManager()
returns the global LicenseManager object (there is only one) |
java.util.Collection<License> |
getLicenses()
returns an umnodifiable view of the embedded licenses |
Logger |
getLogger()
returns the logger that logs changes and access to the LicenseManager |
License |
install(License l)
installs the given license into this LicenseManager, so that it can be found if a check on the licensee is made. |
void |
loadFrom(java.io.File file)
a convenience method that installs serialized licenses from a file |
void |
loadFrom(java.io.InputStream stream)
a convenience method that installs serialized licenses from a stream. |
void |
loadFrom(java.net.URL url)
a convenience method that installs serialized licenses from a URL |
void |
removeAllLicenses()
|
License |
removeLicense(License l)
|
void |
store(java.io.OutputStream stream)
each license is written as a serialized byte array |
void |
verifyLicense(License l)
checks the signature against the certificate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Logger getLogger()
public static LicenseManager getLicenseManager()
throws java.lang.SecurityException
java.lang.SecurityException - if the correct certificate cannot be found
public void loadFrom(java.io.File file)
throws java.io.FileNotFoundException,
LicensingException
java.io.FileNotFoundException
LicensingException
public void loadFrom(java.net.URL url)
throws java.io.IOException,
LicensingException
java.io.IOException
LicensingException
public void loadFrom(java.io.InputStream stream)
throws LicensingException
LicensingException
public void store(java.io.OutputStream stream)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Collection<License> getLicenses()
public void check(java.lang.Object licensee)
throws LicensingException
use() method
of the license object will be called if a valid license was found.
LicensingException - if either no license was found or the found
license was invalidLicense.use()
public License install(License l)
throws LicensingException
LicensingException - if the license cannot be verified (i.e. if it is
not properly signed)check(Object),
verifyLicense(License)public License removeLicense(License l)
public void removeAllLicenses()
public License getLicense(java.lang.Object licensee)
public void verifyLicense(License l)
throws LicensingException
LicensingException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||