Package com.labs64.netlicensing.service
Class ProductModuleService
java.lang.Object
com.labs64.netlicensing.service.ProductModuleService
Provides product module handling routines.
Product may comprise of multiple product modules, but must have at least one. Each product module is licensed using one of the licensing models offered by NetLicensing service. Licensing within a product module is independent of other product modules, however all product modules of a single product are visible to every licensee of the product.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductModule
create
(Context context, String productNumber, ProductModule productModule) Creates new product module object with given properties.static void
Deletes product module.static ProductModule
Gets product module by its number.static Page<ProductModule>
Returns all product modules of a vendor.static ProductModule
update
(Context context, String number, ProductModule productModule) Updates product module properties.
-
Constructor Details
-
ProductModuleService
public ProductModuleService()
-
-
Method Details
-
create
public static ProductModule create(Context context, String productNumber, ProductModule productModule) throws NetLicensingException Creates new product module object with given properties.- Parameters:
context
- determines the vendor on whose behalf the call is performedproductNumber
- parent product to which the new product module is to be addedproductModule
- 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 product module object
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
get
Gets product module by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the product module number- Returns:
- the product module
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
list
Returns all product modules 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 product modules (of all products) 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 ProductModule update(Context context, String number, ProductModule productModule) throws NetLicensingException Updates product module properties.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- product module numberproductModule
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- updated product module.
- 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 product module.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- product module 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.
-