Wasabi ExpressPlay SDK for Desktop Systems  1.23.0
Typedefs | Functions
WSB_LicenseStore Class

Marlin Broadband license database access. More...

Typedefs

typedef struct WSB_LicenseStore WSB_LicenseStore
 A WSB_LicenseStore object is used to access the Wasabi License Store in which licenses may be stored. More...
 

Functions

WSB_EXPORT WSB_Result WSB_LicenseStore_Open (WSB_LicenseStore **store)
 Opens the License Store and creates a new WSB_LicenseStore object to refer to it. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_AddLicense (WSB_LicenseStore *store, const void *data, WSB_Size data_size, const char *tag, WSB_UInt32 *lid)
 Adds a license into the License Store. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_FindLicensesByContentIds (WSB_LicenseStore *store, const char **cids, WSB_Cardinal id_count, SHI_Data **licenses)
 Finds in the License Store the license(s) with specified content ID(s). More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_FindContentIdsByLicense (WSB_LicenseStore *store, WSB_UInt32 lid, SHI_Data **cids)
 Finds in the License Store the content ID(s) governed by the license with the specified license ID. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_GetLicenseById (WSB_LicenseStore *store, WSB_UInt32 lid, SHI_Data **license)
 Obtains from the License Store the license with a specified license ID. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateLicenses (WSB_LicenseStore *store, WSB_Flags flags, SHI_Data **licenses)
 Obtains from the License Store all licenses. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateContentIds (WSB_LicenseStore *store, SHI_Data **cids)
 Obtains from the License Store all content IDs governed by the licenses in the License Store. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_ExpungeExpiredLicenses (WSB_LicenseStore *store)
 Expunges from the License Store all the expired licenses and vacuums the database. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_RemoveLicense (WSB_LicenseStore *store, WSB_UInt32 lid)
 Removes from the License Store the license with a specified license ID. More...
 
WSB_EXPORT WSB_Result WSB_LicenseStore_Close (WSB_LicenseStore *store)
 Closes the License Store and releases the specified WSB_LicenseStore object referring to it. More...
 

Detailed Description

Marlin Broadband license database access.

Typedef Documentation

◆ WSB_LicenseStore

A WSB_LicenseStore object is used to access the Wasabi License Store in which licenses may be stored.

Function Documentation

◆ WSB_LicenseStore_AddLicense()

WSB_EXPORT WSB_Result WSB_LicenseStore_AddLicense ( WSB_LicenseStore store,
const void *  data,
WSB_Size  data_size,
const char *  tag,
WSB_UInt32 lid 
)

Adds a license into the License Store.

If the specified license already exists in the License Store, this method returns WSB_ERROR_LS_DUPLICATE_LICENSE.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
dataA pointer to the license.
data_sizeThe size of the license data, in bytes.
tagA pointer to a NULL-terminated 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. Can be NULL.
lidAddress of a WSB_UInt32 pointer that will be set to refer to the license ID assigned by the License Store to the added license. Can be NULL.

◆ WSB_LicenseStore_Close()

WSB_EXPORT WSB_Result WSB_LicenseStore_Close ( WSB_LicenseStore store)

Closes the License Store and releases the specified WSB_LicenseStore object referring to it.

Parameters
storeA WSB_LicenseStore object referencing the License Store.

◆ WSB_LicenseStore_EnumerateContentIds()

WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateContentIds ( WSB_LicenseStore store,
SHI_Data **  cids 
)

Obtains from the License Store all content IDs governed by the licenses in the License Store.

This method returns WSB_ERROR_LS_NO_CID if no content ID is found or WSB_ERROR_LS_FAIL_LOOKUP if an error occurred during enumeration.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
cidsAddress of a SHI_Data pointer that will, upon successful return, be set to point to a SHI_Data object representing an array of one or more content IDs. This SHI_Data object will have a value of type SHI_DATA_TYPE_ARRAY, where each element in the array will be of type SHI_DATA_TYPE_STRING, so its value is a const char*. Each const char* in the array points to a NULL-terminated content ID. The caller is responsible for calling SHI_Data_Release to release the SHI_Data object containing the array when it is no longer needed. The content ID(s) pointed to by the array are no longer valid and should not be accessed after the caller has called SHI_Data_Release.

◆ WSB_LicenseStore_EnumerateLicenses()

WSB_EXPORT WSB_Result WSB_LicenseStore_EnumerateLicenses ( WSB_LicenseStore store,
WSB_Flags  flags,
SHI_Data **  licenses 
)

Obtains from the License Store all licenses.

The flags parameter allows the caller to select the license-related data (license data, expiration date, insertion date, tag) to be included in each WSB_License object. If some of this data is not specified for inclusion, a potentially large amount of memory resources may be saved, if there are a large number of licenses in the License Store. This method returns WSB_ERROR_LS_NO_LICENSE if the License Store is empty or WSB_ERROR_LS_FAIL_LOOKUP if an error occurred during enumeration.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
flagsFlags selecting license-related data to include.
licensesAddress of a SHI_Data pointer that will, upon successful return, be set to point to a SHI_Data object representing an array of one or more licenses. This SHI_Data object will have a value of type SHI_DATA_TYPE_ARRAY, where each element in the array will be of type SHI_DATA_TYPE_POINTER, so its value is a SHI_TypedPointer. Each SHI_TypedPointer structure in the array will have its type_id field set to WSB_TYPE_ID_LICENSE and its pointer field pointing to a WSB_License object. The caller is responsible for calling SHI_Data_Release to release the SHI_Data object containing the array when it is no longer needed. The WSB_License objects pointed to by the array are no longer valid and should not be accessed after the caller has called SHI_Data_Release.

◆ WSB_LicenseStore_ExpungeExpiredLicenses()

WSB_EXPORT WSB_Result WSB_LicenseStore_ExpungeExpiredLicenses ( WSB_LicenseStore store)

Expunges from the License Store all the expired licenses and vacuums the database.

Vacuum is resource-intensive and takes some time to run. It is best to call this function during idle times.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
Since
1.9

◆ WSB_LicenseStore_FindContentIdsByLicense()

WSB_EXPORT WSB_Result WSB_LicenseStore_FindContentIdsByLicense ( WSB_LicenseStore store,
WSB_UInt32  lid,
SHI_Data **  cids 
)

Finds in the License Store the content ID(s) governed by the license with the specified license ID.

This method returns WSB_ERROR_LS_NO_CID if no content ID is found or WSB_ERROR_LS_FAIL_LOOKUP if an error occurred during lookup.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
lidThe license ID of the license that governs the content ID(s) to be obtained.
cidsAddress of a SHI_Data pointer that will, upon successful return, be set to point to a SHI_Data object representing an array of one or more content IDs. This SHI_Data object will have a value of type SHI_DATA_TYPE_ARRAY, where each element in the array will be of type SHI_DATA_TYPE_STRING, so its value is a const char*. Each const char* in the array points to a NULL-terminated content ID. The caller is responsible for calling SHI_Data_Release to release the SHI_Data object containing the array when it is no longer needed. The content ID(s) pointed to by the array are no longer valid and should not be accessed after the caller has called SHI_Data_Release.

◆ WSB_LicenseStore_FindLicensesByContentIds()

WSB_EXPORT WSB_Result WSB_LicenseStore_FindLicensesByContentIds ( WSB_LicenseStore store,
const char **  cids,
WSB_Cardinal  id_count,
SHI_Data **  licenses 
)

Finds in the License Store the license(s) with specified content ID(s).

This method returns WSB_ERROR_LS_NO_LICENSE if the License Store is empty or no match was found, or WSB_ERROR_LS_FAIL_LOOKUP if an error occurred during lookup.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
cidsAn array of one or more pointers to NULL-terminated constant character strings, 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 WSB_LicenseStore_EnumerateLicenses.
id_countNumber of content IDs in cids.
licensesAddress of a SHI_Data pointer that will, upon successful return, be set to point to a SHI_Data object representing an array of one or more licenses. This SHI_Data object will have a value of type SHI_DATA_TYPE_ARRAY, where each element in the array will be of type SHI_DATA_TYPE_POINTER, so its value is a SHI_TypedPointer. Each SHI_TypedPointer structure in the array will have its type_id field set to WSB_TYPE_ID_LICENSE and its pointer field pointing to a WSB_License object. The caller is responsible for calling SHI_Data_Release to release the SHI_Data object containing the array when it is no longer needed. The WSB_License objects pointed to by the array are no longer valid and should not be accessed after the caller has called SHI_Data_Release.

◆ WSB_LicenseStore_GetLicenseById()

WSB_EXPORT WSB_Result WSB_LicenseStore_GetLicenseById ( WSB_LicenseStore store,
WSB_UInt32  lid,
SHI_Data **  license 
)

Obtains from the License Store the license with a specified license ID.

This method returns WSB_ERROR_LS_NO_LICENSE if the License Store is empty or does not contain the specified license, or WSB_ERROR_LS_FAIL_LOOKUP if an error occurred during lookup.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
lidThe license ID for the license to be obtained.
licenseAddress of a SHI_Data pointer that will, upon successful return, be set to point to a SHI_Data object representing one license. This SHI_Data object will have a value of type SHI_DATA_TYPE_POINTER, so its value is a SHI_TypedPointer. The SHI_TypedPointer structure will have its type_id field set to WSB_TYPE_ID_LICENSE and its pointer field pointing to a WSB_License object. The caller is responsible for calling SHI_Data_Release to release the SHI_Data object containing the license when it is no longer needed. The WSB_License object will no longer be valid and should not be accessed after the caller has called SHI_Data_Release.

◆ WSB_LicenseStore_Open()

WSB_EXPORT WSB_Result WSB_LicenseStore_Open ( WSB_LicenseStore **  store)

Opens the License Store and creates a new WSB_LicenseStore object to refer to it.

If the License Store (database) does not yet exist, this method creates it. The WSB_LicenseStore object must be released by calling WSB_LicenseStore_Close when it is no longer needed. If an error occurs while attempting to open the License Store, this method returns WSB_ERROR_LS_OPEN_DB.

Parameters
storeAddress of a WSB_LicenseStore pointer that will be set to refer to the WSB_LicenseStore object created.

◆ WSB_LicenseStore_RemoveLicense()

WSB_EXPORT WSB_Result WSB_LicenseStore_RemoveLicense ( WSB_LicenseStore store,
WSB_UInt32  lid 
)

Removes from the License Store the license with a specified license ID.

This method returns WSB_ERROR_LS_REMOVE_LICENSE if it encounters an error.

Parameters
storeA WSB_LicenseStore object referencing the License Store.
lidThe license ID for the license to be removed.