Package com.labs64.netlicensing.service
Class LicenseTemplateService
java.lang.Object
com.labs64.netlicensing.service.LicenseTemplateService
Provides license template handling routines.
License template is a configuration element of a product module. License templates define concrete items available for a licensee to obtain. License template specifies what is an item, its price, amount (if applicable), etc. When licensee obtains an item, actual license is created off the corresponding license template, and this license is assigned to the licensee. Thus, the item is licensed for the Licensee.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LicenseTemplate
create
(Context context, String productModuleNumber, LicenseTemplate licenseTemplate) Creates new license template object with given properties.static void
Deletes license template.static LicenseTemplate
Gets license template by its number.static Page<LicenseTemplate>
Returns all license templates of a vendor.static LicenseTemplate
update
(Context context, String number, LicenseTemplate licenseTemplate) Updates license template properties.
-
Constructor Details
-
LicenseTemplateService
public LicenseTemplateService()
-
-
Method Details
-
create
public static LicenseTemplate create(Context context, String productModuleNumber, LicenseTemplate licenseTemplate) throws NetLicensingException Creates new license template object with given properties.- Parameters:
context
- determines the vendor on whose behalf the call is performedproductModuleNumber
- parent product module to which the new license template is to be addedlicenseTemplate
- non-null properties will be taken for the new object, null properties will either stay null, or will be set to a default value, depending on property.- Returns:
- the newly created license template object
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
get
Gets license template by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the license template number- Returns:
- the license template
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
list
public static Page<LicenseTemplate> list(Context context, String filter) throws NetLicensingException Returns all license templates of a vendor.- Parameters:
context
- determines the vendor on whose behalf the call is performedfilter
- reserved for the future use, must be omitted / set to NULL- Returns:
- list of license templates (of all products/modules) or null/empty list if nothing found.
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
update
public static LicenseTemplate update(Context context, String number, LicenseTemplate licenseTemplate) throws NetLicensingException Updates license template properties.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- license template numberlicenseTemplate
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- updated license template.
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
delete
public static void delete(Context context, String number, boolean forceCascade) throws NetLicensingException Deletes license template.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- license template numberforceCascade
- if true, any entities that depend on the one being deleted will be deleted too- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-