Class TransactionService

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

public class TransactionService extends Object
Provides transaction handling routines.

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 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 performed
      transaction - 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

      public static Transaction get(Context context, String number) throws NetLicensingException
      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 performed
      number - the transaction number
      Returns:
      the transaction
      Throws:
      NetLicensingException - any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
    • list

      public static Page<Transaction> list(Context context, String filter) throws NetLicensingException
      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 performed
      filter - 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 performed
      number - transaction number
      transaction - 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.