Class LicenseeService
Licensee is usually an end customer, capable of obtaining licenses for the product. Each licensee is associated with a single product. From the vendor perspective a licensee object in NetLicensing may correspond to a physical instance of the product, customer account within a vendor's service, or it can represent a security dongle given to a user. In practice, each licensee must only have a unique identifier associated with it, that is communicated to NetLicensing as licensee number for performing operations related to this licensee. Licensee doesn't need to have an own account within NetLicensing. There are two main operations performed for licensees: validation and obtaining new licenses. Validation process is typically completely transparent to the end user and performed from the vendor's product by means of this API. Licensee can be offered to obtain new licenses for the product by redirecting the user to the NetLicensing Shop in the web browser.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Licensee
Creates new licensee object with given properties.static void
Deletes licensee.static Licensee
Gets licensee by its number.Returns all licensees of a vendor.static void
Transfer licenses between licensees.static Licensee
Updates licensee properties.static ValidationResult
validate
(Context context, String number, ValidationParameters validationParameters, MetaInfo... meta) Validates active licenses of the licensee.static ValidationResult
validate
(Context context, String number, String productNumber, String licenseeName, ValidationParameters validationParameters, MetaInfo... meta) Deprecated.
-
Constructor Details
-
LicenseeService
public LicenseeService()
-
-
Method Details
-
create
public static Licensee create(Context context, String productNumber, Licensee licensee) throws NetLicensingException Creates new licensee object with given properties.- Parameters:
context
- determines the vendor on whose behalf the call is performedproductNumber
- parent product to which the new licensee is to be addedlicensee
- 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 licensee object
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
get
Gets licensee by its number.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the licensee number- Returns:
- the licensee
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
list
Returns all licensees 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 licensees (of all products) or null/empty list if nothing found.
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
update
public static Licensee update(Context context, String number, Licensee licensee) throws NetLicensingException Updates licensee properties.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numberlicensee
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- updated licensee.
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
delete
public static void delete(Context context, String number, boolean forceCascade) throws NetLicensingException Deletes licensee.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numberforceCascade
- if true, any entities that depend on the one being deleted will be deleted too- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
validate
@Deprecated public static ValidationResult validate(Context context, String number, String productNumber, String licenseeName, ValidationParameters validationParameters, MetaInfo... meta) throws NetLicensingException Deprecated.Validates active licenses of the licensee.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numberproductNumber
- optional productNumber, must be provided in case licensee auto-create is enabledlicenseeName
- optional human-readable licensee name in case licensee will be auto-createdvalidationParameters
- optional validation parameters, specific to licensing model. See licensing model documentation for details.meta
- optional parameter, receiving messages returned within responsesection. - Returns:
- result of the validation
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
validate
public static ValidationResult validate(Context context, String number, ValidationParameters validationParameters, MetaInfo... meta) throws NetLicensingException Validates active licenses of the licensee. In the case of multiple product modules validation, required parameters indexes will be added automatically.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- licensee numbervalidationParameters
- optional validation parameters. See ValidationParameters and licensing model documentation for details.meta
- optional parameter, receiving messages returned within responsesection. - Returns:
- result of the validation
- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-
transfer
public static void transfer(Context context, String number, String sourceLicenseeNumber) throws NetLicensingException Transfer licenses between licensees.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the number of the licensee receiving licensessourceLicenseeNumber
- the number of the licensee delivering licenses- Throws:
NetLicensingException
- in case of a service error. Check subclass and message for details.
-