Package com.labs64.netlicensing.service
Class ProductService
java.lang.Object
com.labs64.netlicensing.service.ProductService
Provides product handling routines.
Product entity represents the vendor product within NetLicensing. Usually it corresponds to an actual product of the vendor, but variations possible - in some cases it may be feasible to configure two or more separate products within NetLicensing for a single actual product of the vendor. Products comprise of multiple product modules, and licensing rules are defined for each product module. The products are completely independent of each other in terms of license management. Once product is configured, licensees can be registered with the product. Licensees can obtain licenses according to configured license templates.
-
Constructor Details
-
ProductService
public ProductService()
-
-
Method Details
-
create
Creates new product with given properties.- Parameters:
context
- determines the vendor on whose behalf the call is performedproduct
- 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 object
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
get
Gets product by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the product number- Returns:
- the product
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
list
Returns products 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:
- collection of product entities 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 Product update(Context context, String number, Product product) throws NetLicensingException Updates product properties.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- product numberproduct
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- updated product.
- 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.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- product 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.
-