public class LicenseStore
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
WSB_LS_FLAG_LICENSE_DATA
License data
|
static int |
WSB_LS_FLAG_LICENSE_EXPIRE_DATE
License expiration date
|
static int |
WSB_LS_FLAG_LICENSE_INSERT_DATE
License insertion date
|
static int |
WSB_LS_FLAG_LICENSE_TAG
License tag
|
Constructor and Description |
---|
LicenseStore()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addLicense(java.lang.String data,
java.lang.String tag)
Adds a license into the License Store.
|
void |
close()
Closes the License Store.
|
java.lang.String[] |
enumerateContentIds()
Obtains from the License Store all content IDs governed by the
licenses in the License Store.
|
License[] |
enumerateLicenses(int flags)
Obtains from the License Store all licenses.
|
void |
expungeExpiredLicenses()
Expunges from the License Store all the expired licenses and vacuums the
database.
|
java.lang.String[] |
findContentIdsByLicense(int lid)
Finds in the License Store the content ID(s) governed by the license
with the specified license ID.
|
License[] |
findLicensesByContentIds(java.lang.String[] contentIds)
Finds in the License Store the license(s) with specified content ID(s).
|
License |
getLicenseById(int lid)
Obtains from the License Store the license with a specified license ID.
|
void |
removeLicense(int lid)
Removes from the License Store the license with a specified license ID.
|
public static final int WSB_LS_FLAG_LICENSE_DATA
public static final int WSB_LS_FLAG_LICENSE_EXPIRE_DATE
public static final int WSB_LS_FLAG_LICENSE_INSERT_DATE
public static final int WSB_LS_FLAG_LICENSE_TAG
public LicenseStore() throws ErrorCodeException
ErrorCodeException
public int addLicense(java.lang.String data, java.lang.String tag) throws ErrorCodeException, java.lang.NullPointerException
data
- A String representing the license.tag
- a String to support tagging. For example, the tag could be
something like "myAppA inserted this license", where "myAppA" would actually
be the name of the application that inserted the license.ErrorCodeException
java.lang.NullPointerException
- if the data or tag parameter is nullpublic License[] findLicensesByContentIds(java.lang.String[] contentIds) throws ErrorCodeException, java.lang.NullPointerException
contentIds
- An array of one String, each specifying a content ID.
If a request is made with an empty content ID list, all licenses
in the License Store will be returned, although the preferred method
of obtaining all licenses in the License Store is to call
enumerateLicenses.ErrorCodeException
java.lang.NullPointerException
- if contentIds parameter is nullpublic java.lang.String[] findContentIdsByLicense(int lid) throws ErrorCodeException
lid
- The license ID of the license that governs the content ID(s) to
be obtained.ErrorCodeException
public License getLicenseById(int lid) throws ErrorCodeException
lid
- The license ID for the license to be obtained.ErrorCodeException
public License[] enumerateLicenses(int flags) throws ErrorCodeException
flags
- Flags selecting license-related data to include.ErrorCodeException
public java.lang.String[] enumerateContentIds() throws ErrorCodeException
ErrorCodeException
public void expungeExpiredLicenses() throws ErrorCodeException
ErrorCodeException
public void removeLicense(int lid) throws ErrorCodeException
lid
- The license ID for the license to be removed.ErrorCodeException
public void close() throws ErrorCodeException
ErrorCodeException