Class TransactionService
Transaction is created each time change to licenses happens. For instance licenses are obtained by a licensee, licenses disabled by vendor, licenses deleted, etc. Transaction is created no matter what source has initiated the change to licenses: it can be either a direct purchase of licenses by a licensee via NetLicensing Shop, or licenses can be given to a licensee by a vendor. Licenses can also be assigned implicitly by NetLicensing if it is defined so by a license model (e.g. evaluation license may be given automatically). All these events are reflected in transactions. Of all the transaction handling routines only read-only routines are exposed to the public API, as transactions are only allowed to be created and modified by NetLicensing internally.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Transaction
create
(Context context, Transaction transaction) Creates new transaction object with given properties.static Transaction
Gets transaction by its number.static Page<Transaction>
Returns all transactions of a vendor.static Transaction
update
(Context context, String number, Transaction transaction) Updates transaction properties.
-
Constructor Details
-
TransactionService
public TransactionService()
-
-
Method Details
-
create
public static Transaction create(Context context, Transaction transaction) throws NetLicensingException Creates new transaction object with given properties.This routine is for internal use by NetLicensing. Where appropriate, transactions will be created by NetLicensing automatically.
- Parameters:
context
- determines the vendor on whose behalf the call is performedtransaction
- 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 transaction object
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
get
Gets transaction by its number.Use this operation for getting details about certain transaction. List of all transactions can be obtained by the
list(Context, String)
operation.- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- the transaction number- Returns:
- the transaction
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-
list
Returns all transactions of a vendor.Use this operation to get the list of all transactions.
- 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 transactions (of all products/licensees) 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 Transaction update(Context context, String number, Transaction transaction) throws NetLicensingException Updates transaction properties.This routine is for internal use by NetLicensing. Where appropriate, transactions will be modified by NetLicensing automatically.
- Parameters:
context
- determines the vendor on whose behalf the call is performednumber
- transaction numbertransaction
- non-null properties will be updated to the provided values, null properties will stay unchanged.- Returns:
- updated transaction.
- Throws:
NetLicensingException
- any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
-