Class TokenService

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

public class TokenService extends Object
Provides token entity handling routines.
  • Constructor Details

    • TokenService

      public TokenService()
  • Method Details

    • get

      public static Token get(Context context, String number) throws NetLicensingException
      Gets token by its number.
      Parameters:
      context - determines the vendor on whose behalf the call is performed
      number - the token number
      Returns:
      the token
      Throws:
      NetLicensingException - any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.
    • list

      public static Page<Token> list(Context context, String filter) throws NetLicensingException
      Returns tokens of a vendor.
      Parameters:
      context - determines the vendor on whose behalf the call is performed
      filter - additional criteria to filter type of tokens to return, if NULL return tokens of all types
      Returns:
      collection of token 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.
    • create

      public static Token create(Context context, Token token) throws NetLicensingException
      Creates new token.
      Parameters:
      context - determines the vendor on whose behalf the call is performed
      token - non-null properties will be updated to the provided values, null properties will stay unchanged.
      Returns:
      created token
      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) throws NetLicensingException
      Delete token by its number.
      Parameters:
      context - determines the vendor on whose behalf the call is performed
      number - the token number
      Throws:
      NetLicensingException - any subclass of NetLicensingException. These exceptions will be transformed to the corresponding service response messages.