Class ProductService


  • public class ProductService
    extends Object
    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 Detail

      • ProductService

        public ProductService()
    • Method Detail

      • create

        public static Product create​(Context context,
                                     Product product)
                              throws NetLicensingException
        Creates new product with given properties.
        Parameters:
        context - determines the vendor on whose behalf the call is performed
        product - 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.
      • list

        public static Page<Product> list​(Context context,
                                         String filter)
                                  throws NetLicensingException
        Returns products of a vendor.
        Parameters:
        context - determines the vendor on whose behalf the call is performed
        filter - 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 performed
        number - product number
        product - 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 performed
        number - product number
        forceCascade - 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.