Class LicenseTemplateService

java.lang.Object
com.labs64.netlicensing.service.LicenseTemplateService

public class LicenseTemplateService extends Object
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 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 performed
      productModuleNumber - parent product module to which the new license template is to be added
      licenseTemplate - 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

      public static LicenseTemplate get(Context context, String number) throws NetLicensingException
      Gets license template by its number.
      Parameters:
      context - determines the vendor on whose behalf the call is performed
      number - 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 performed
      filter - 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 performed
      number - license template number
      licenseTemplate - 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 performed
      number - license template 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.